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}

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

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


2 Answers 2


Could you perhaps do...

{exp:query sql="SELECT primary_category_id FROM exp_primary_category WHERE entry_id='{segment_2}'"}
    {if no_results}

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.


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

  • 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.