2

Is there a way to display something if there IS NOT a primary category?

We've tried these with no luck:

{exp:primary_category entry_id="{segment_2}"}


{if primary_category_id}
YES 
{if:else}
NO
{/if}

{if primary_category_id} YES {/if}<br>

{if primary_category_id == ""} NO {/if}<br>

{/exp:primary_category}

2 Answers 2

1

Could you perhaps do...

{exp:query sql="SELECT primary_category_id FROM exp_primary_category WHERE entry_id='{segment_2}'"}
    {embed="site/yes"}
    {if no_results}
        {embed="site/no"}
    {/if}
{/exp:query}

Be careful of placing this inside a channel:entries loop though as the {if no_results} tag will be caught by that instead of the query loop.

Not verified but worth a try.

0

Sorry, this is not available with Primary Category at this time.

1
  • Any way this might be do-able this an embed or some other such logic? Commented Jun 11, 2014 at 7:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.