I’m trying to pull the results of child categories when looking at the parent category page.
{exp:query sql="SELECT cat_id, cat_name, parent_id FROM exp_categories WHERE cat_url_title = '{segment_2}'"}
<h1>{cat_name}</h1>
{if {parent_id} != 0}
<ul class="category">
{embed="blog/inc_category" cat_id="{cat_id}"}
</ul>
{if:else}
{exp:query sql="SELECT cat_id FROM exp_categories WHERE parent_id = '{cat_id}'"}
This breaks.
{/exp:query}
{/if}
{/exp:query}But I get this returned
Parse error: syntax error, unexpected T_ENDIF in .../library/expressionengine/libraries/Functions.php(640) : eval()‘d code on line 86
I even tried hardcoding cat_id to an existing value with same result.
Any ideas?