Plugin

Developer
Supported

Entry Categories

ExpressionEngine 1.x, ExpressionEngine 2

Back to this add-on's main page
View Other Add-ons From Laisvunas

     

You must be logged in to post.

How to

General

masterexmachina
masterexmachina

Before I buy plugin I want to have answer to following question.
Entry has one main category and one child category selected. I need to show child category if it is selected, and there are 10 child categories to be selected. I need only one. how to do it?

Laisvunas
# 1
Developer
Laisvunas

Hi,

You can achieve what you need by using the code as this:

{if level1_category0_cat_id != ""}{level1_category0_cat_name}
{if
:elseif level1_category1_cat_id != ""}{level1_category1_cat_name}
{if
:elseif level1_category2_cat_id != ""}{level1_category2_cat_name}
{if
:elseif level1_category3_cat_id != ""}{level1_category3_cat_name}
{if
:elseif level1_category4_cat_id != ""}{level1_category4_cat_name}
{if
:elseif level1_category5_cat_id != ""}{level1_category5_cat_name}
{if
:elseif level1_category6_cat_id != ""}{level1_category6_cat_name}
{if
:elseif level1_category7_cat_id != ""}{level1_category7_cat_name}
{if
:elseif level1_category8_cat_id != ""}{level1_category8_cat_name}
{if
:elseif level1_category9_cat_id != ""}{level1_category9_cat_name}
{
/if}