This question may be related to a resolved thread.
I’m trying to insert a simple conditional statement within a SCRIPT tag. Basically, I’m using Channel Images along with a script called supersized, and I need EE to insert a comma between all Channel Image entries, except at the end of the entries (IE compatibility issues).
The problem:
the if statement does not seem to be recognized as an EE tag so the code outputs commas everywhere. I’ve tried all variations of the $config[‘debug’] variable but this never gives me the proper output. Of course, outside of the script tag, the same code works perfectly well.
slides : [ //Slideshow Images2-te3
{exp:channel:entries channel="{mychannel}"}
{exp:channel_images:images entry_id="{structure:page:entry_id}"}
{
image : '{image:url:home_bg}'}
{if '{image:count}' < '{image:total}'}
,
{/if}
{/exp:channel_images:images}
{/exp:channel:entries}
]Notes
I placed the opening curly bracket on a different line before the statement image : ‘{image:url:home_bg}’} so that EE would not read this as an EE tag since it’s part of the script parameter syntax.
Any suggestions as to what I could try to resolve this?
Output sample with $config[‘debug’] = “1”
slides : [ //Slideshow Images2-te3
{
image : 'http://paxrodentiaprotege1.dyndns.org:8888/mwa002b/images/channel-images/34/homepage-4__home_bg.jpg'}
{if '1' < '10'}
,
{/if}
{
image : 'http://paxrodentiaprotege1.dyndns.org:8888/mwa002b/images/channel-images/34/homepage-5__home_bg.jpg'}
{if '2' < '10'}
,
{/if}
etc…
Output sample with $config[‘debug’] = “0” (the if EE tags seem to be ignored, the page outputs a comma no matter what)
slides : [ //Slideshow Images2-te3
{
image : 'http://paxrodentiaprotege1.dyndns.org:8888/mwa002b/images/channel-images/34/homepage-4__home_bg.jpg'}
,
{
image : 'http://paxrodentiaprotege1.dyndns.org:8888/mwa002b/images/channel-images/34/homepage-5__home_bg.jpg'}
,etc…