I’m trying to use an embed within a conditional to control whether some navigation links appear as text or links. At first I was testing for no result. This didn’t work. So I changed the embed to return an x if there were no results. Testing has shown this is working. But when I stick the same code that returned the x into a conditional, it doesn’t work. I’ve tried a bunch of variations of single and double quotes and this is one that at least gets parsed; but I can’t get it to make it recognize the x and give me the code without the links. It always takes the if:else route. Suggestions?
{if "embed='embeds/.serial-next the-entry='{entry_id}' the-serial='{related_entries id="series"}{entry_id}{/related_entries}'" == "x"}
(code that makes the nav text appear as text)
{if:else}
(code that makes the nav text appear as links)Edit: After I posted I tried to do this with PHP, and I’m getting a similar result. I’m able to echo the result of the no-results embed, but when I use it in a PHP if statement it doesn’t recognize it and always give the if:else route.
<?php
$next_page = '{embed="embeds/.serial-next the-entry="{entry_id}" the-serial="{related_entries id="series"}{entry_id}{/related_entries}"}';
if ( $next_page == "x" )
{echo "(code that makes the nav text appear as text)";}
else
{echo "(code that makes the nav text appear as links)";}
?>