I am having the most bizarre issues with this template parsing I’m trying to do and i was wondering if any of you could shine a light on what is going on.
I am trying to use some simple conditionals inside a exp:channel:entries tag for things like status and limit as it is an embedded template.
firstly if no embedded status variable is set this will return nothing:
{exp:channel:entries channel="news" orderby="date" sort="desc"{if embed:limit != ""} limit="{embed:limit}"{/if} status="{if embed:status == ""}open|featured{/if}{if embed:status != ""}{embed:status}{/if}"}however if one is set then those status posts are pulled. Now i did manage to get it working, but this is the weirdest thing of all, including a space makes it work. I put the status=”” inside the ifs and with this code the same is true of the error above:
{exp:channel:entries channel="news" orderby="date" sort="desc"{if embed:limit != ""} limit="{embed:limit}"{/if}{if embed:status == ""}status="open|featured"{/if}{if embed:status != ""}status="{embed:status}"{/if}}but with this code it works:
{exp:channel:entries channel="news" orderby="date" sort="desc"{if embed:limit != ""} limit="{embed:limit}"{/if}{if embed:status == ""} status="open|featured"{/if}{if embed:status != ""}status="{embed:status}"{/if}}the space before ‘status=“open|featured”’ is the only difference. Also, if i put a space in front of ‘status=”{embed:status}”’ then the code yet again breaks with the same issue.
Is there anyone who has had similar things? Also is there any when where both open and featured show by default making all this code unnecessary?
Thanks in advanced.