JSON output

Permalink Browser Info Environment
Hi

I was wondering if there was a way to modify the view of data display block to output entries as a json array?
i was hoping to use custom views on the blocks to utilise js or something like google maps etc that require data in json format.
Here for exmple is a way of using a page list custom view to use google maps with page attributes of lat/long
<?php
defined('C5_EXECUTE') or die("Access Denied.");
$th = Loader::helper('text');
?>
<?php
$addresses = array();
foreach ($pages as $page):
    $title = $th->entities($page->getCollectionName());
    $url = $nh->getLinkToCollection($page);
    $lat = $page->getAttribute('lat');
    $long = $page->getAttribute('long');
    if ($lat && $long) {
        $position = 'latLng: ['.$lat.', '.$long .']';
        $addresses[] = '{'.$position .', data:'.json_encode($url). '}';
    }


I was hoping for something similar. Output the data from advanced forms with data display and custom view it to create a map or something similar.

Any help would be greatly appreciated.

Adam

Type: Pre-Sale
Status: New
fauners
View Replies:

concrete5 Environment Information

# concrete5 Version
5.6.3.3

# concrete5 Packages
Advanced Forms (1.13.1), Bootstrap (3.1.1.4), Data Display (2.7.1.4), engagingit_table_sorter (1.1), Foundation 5 (1.6.0), Login (1.1.1), Pro Events (11.1.0), Pro Forms (7.6.2).

# concrete5 Overrides
languages/ar, languages/cs_CZ, languages/da_DK, languages/de_DE, languages/el_GR, languages/es_AR, languages/es_ES, languages/es_MX, languages/es_PE, languages/fa_IR, languages/fi_FI, languages/fr_FR, languages/it_IT, languages/ja_JP, languages/nb_NO, languages/nl_NL, languages/pt_PT, languages/ro_RO, languages/ru_RU, languages/sk_SK, languages/sl_SI, languages/sv_SE, languages/tr_TR, languages/vi_VN, languages/zh_TW

# concrete5 Cache Settings
Block Cache - On
Overrides Cache - On
Full Page Caching - Off

# Server Software
Apache/2.4.10 (Win32) OpenSSL/1.0.1i PHP/5.5.19

# Server API
apache2handler

# PHP Version
5.5.19

# PHP Extensions
apache2handler, bcmath, bz2, calendar, Core, ctype, curl, date, dom, ereg, exif, filter, ftp, gd, gettext, hash, iconv, json, libxml, mbstring, mcrypt, mhash, mysql, mysqli, mysqlnd, odbc, openssl, pcre, PDO, pdo_mysql, pdo_sqlite, Phar, Reflection, session, SimpleXML, soap, sockets, SPL, sqlite3, standard, tokenizer, wddx, xml, xmlreader, xmlrpc, xmlwriter, xsl, zip, zlib.

# PHP Settings
max_execution_time - 240
log_errors_max_len - 1024
max_file_uploads - 20
max_input_nesting_level - 64
max_input_time - 60
max_input_vars - 1000
memory_limit - 128M
post_max_size - 8M
sql.safe_mode - Off
upload_max_filesize - 2M
mysql.max_links - Unlimited
mysql.max_persistent - Unlimited
mysqli.max_links - Unlimited
mysqli.max_persistent - Unlimited
odbc.max_links - Unlimited
odbc.max_persistent - Unlimited
pcre.backtrack_limit - 1000000
pcre.recursion_limit - 100000
session.cache_limiter - nocache
session.gc_maxlifetime - 7200
soap.wsdl_cache_limit - 5

Browser User-Agent String

Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/43.0.2357.124 Safari/537.36

Hide Post Content

This will replace the post content with the message: "Content has been removed by an Administrator"

Hide Content

Request Refund

You may not request a refund that is not currently owned by you.