Hi guys, am having a bit of trouble getting EE to output a Javascript array for me.
Here is the code am using
var realId=new Array(
{exp:channel:entries category="1" channel="designs"}
{if listing_img !=""} //Make sure the field is not empty
"{entry_id}"
<? //Add a comma if not last result
$counter = {count};
$total = {total_results};
if ($counter != $total){
echo ",";
};
?>
{/if}
{/exp:channel:entries});Expected Output
var realId=new Array("1011", "1012", "1013");Generated Output
var realId=new Array({if "filedir_2large_corpid.png" !=""}"24"
,{/if}{if "" !=""}"12"
,{/if}{if "" !=""}"11"
,{/if}{if "" !=""}"10"
,{/if}{if "" !=""}"9"
,{/if}{if "" !=""}"8"
,{/if}{if "" !=""}"7"
{/if});EE: v2.1.3
Plugins installed: FF Matrix, ImageSizer, Low Replace
Template Setting:
Type: Webpage
Enable Caching: No
Refresh Interval: 0
Allow PHP? Yes
PHP Parsing Stage: Output