In this template I display information about characters from a TV show. This includes a season-by-season summary of significant events for a character. I am trying to work out a way where adding each new season is more streamlined. Each character is tagged for each season it appears in, with S1, S2, etc. This is what I've currently got:

{exp:tag:tags entry_id="{entry_id}"}

{if tag == "S1" OR tag == "S2" OR tag == "S3"}
{if segment_4 == ""}


{if tag == "S1"}<li><a href="{comment_url_title_auto_path}/Season_One/">Season One</a></li>{/if}
{if tag == "S2"}<li><a href="{comment_url_title_auto_path}/Season_Two/">Season Two</a></li>{/if}
{if tag == "S3"}<li><a href="{comment_url_title_auto_path}/Season_Three/">Season Three</a></li>{/if}


{if segment_4 == "Season_One" OR segment_4 == "Season_Two" OR segment_4 == "Season_Three"}


{if tag == "S1"}
<h4>Season One</h4>


{if tag == "S2"}
<h4>Season Two</h4>


{if tag == "S3"}
<h4>Season Three</h4>




At the moment, the default entry page for a character ends up looking like this:


    Season One


    Season Two


    Season Three

I am not sure why the "Spoilers" heading gets repeated for each link.

Additionally, if I click through on the "Season One" link it ends up displaying season one, season two and season three in one go.

Any suggestions for how I'd need to tweak this template to get the desired result and, preferably, a setup with less duplication of tags needed each time another season is added?

1 Answer 1


Wow that's a lot of conditionals. This loop runs for every tag. So in this case 3 times. If you only want Spoilers to display once, try {if count == '1'}Spoilers</if} Here: {if tag == "S1"}<li><a href="{comment_url_title_auto_path}/Season_One/">Season One</a></li>{/if}

you could try

<li><a href="{comment_url_title_auto_path}/{websafe_tag}/">{tag}</a></li>{/if}

changing the tags to Season 1, Season 2 etc instead of s1, s2. Then things will be dynamic as seasons are added as well.

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.