Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7710495
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T01:08:24+00:00 2026-06-01T01:08:24+00:00

I am using ExpressionEngine 2.2.1 and am trying to create a conditional that will

  • 0

I am using ExpressionEngine 2.2.1 and am trying to create a conditional that will cause a page to show a specific navigation template based on the page’s category. For example, I am creating a public profile for someone who is a part of a competition in London. When someone visits his profile, I would like the page to show, not only his profile, but also a banner with an image of London & navigation that is specific to the London competition. I would like to do this by adding a conditional with categories since we have so many competitors in many different cities. I have created a category titled “London Competitors English” and it has the ID of “56”. Once I have created the competitor’s profile within EE, I select the category, “London Competitors English,” however, when I go to the page, the default navigation template is loading rather than the London template. I created code based on my research and most related example here: http://expressionengine.com/forums/viewthread/185555/. What do I have wrong in my code?:

FILE ONE: (condensed portion of) competitor_profiles_en/index.html where “competitor_profiles_en” is the template:

{exp:channel:entries  limit="1" url_title={segment_2} }
{embed="includes/header"}
<div class="xx">    
<h2>{competitor_first_name}<br>{competitor_last_name}</h2>      
...
</div>
{/exp:channel:entries} 

FILE TWO: (condensed portion of) my header.html file :

{if segment_1 == 'home'}
{embed="includes/_nav_landing"}
{if:elseif "{categories}{category_id}{/categories}" == "56"}
{embed="includes/_nav_city_lon_en"}
{if:else}
{embed="includes/_nav_internal"}
{/if}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T01:08:25+00:00Added an answer on June 1, 2026 at 1:08 am

    The problem is that embeds are processed after all other tags, in a completely separate process. So when your includes/header embed runs, it has no categories to speak of, because it’s not actually running within a Channel Entries tag.

    Unless you need to pass variables to includes/header (which you don’t appear to be doing here, but you may have removed that for simplicity), I’d move your includes/header to a snippet instead, so it will be processed inline with your Channel Entries tag.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an expressionengine template for frontend users using safecracker to create entries. ex:
When using categories in ExpressionEngine, a Category URL Indicator trigger word can be set
I am posting a form in an expressionengine (1.6.8) template. I'm doing it using
I'm working with a CMS (ExpressionEngine) that wraps paragraph tags around images. I'm using
We are trying to create an index on CDX and ADT tables that use
Using Xcode4.2.1, with a basic PhoneGap template based app. (I say template, but I
I'm using expressionengine to create a documentation site, using the weblog module. I have
I've create a blog using a few templates in ExpressionEngine 2, but am struggling
I'm using expressionengine as a CMS but want to override the core validation for
using chrome 15 on osx 10.6.8 When adding event listeners, I've found that putting

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.