We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

channel="navigation" vs entry_id="1"

How Do I?

DxJR's avatar
DxJR
3 posts
6 years ago
DxJR's avatar DxJR

So I’ve built this site that is kind of a dumbed down webpage builder in ExpressionEngine. It all works great, but there’s this one area that isn’t working as I want. Here’s what I have going:

Layout Template:

{exp:channel:entries entry_id="1" limit="1"}
{embed="classic/navigation"}
{/exp:channel:entries}

and then inside the embedded template classic/navigation we have

{exp:channel:entries entry_id="3" limit="1"}
  <nav id="classic-header" class="navbar navbar-default navbar-expand-sm" role="header" >
...
</nav>
{/exp:channel:entries}

that all works well, but if I replace the entry_id="1"and entry_id="3"with channel="site_setting" and channel="navigation" respectively, and leave the limit="1", it doesn’t embed the template any longer. I even have the channels limited to only allow 1 entry. But the weird thing is, i use the exact same layout and everything on the homepage and it works fine using channel names instead of entry ids. This only breaks on the interior pages. Any advice is appreciated. Kind of new to EE. I would just leave it since it’s working, but I”m trying to make it more modular and calling out specific entry_ids doesn’t give me that modularity. Thanks for any input.

       
DxJR's avatar
DxJR
3 posts
6 years ago
DxJR's avatar DxJR

sorry that was so wordy. Maybe easier to understand like this. Ideally i’d prefer this below instead of what’s above

Layout Template:

{exp:channel:entries channel="site_setting" limit="1"}
{embed="classic/navigation"}
{/exp:channel:entries}

Embedded template classic/navigation:

{exp:channel:entries channel="navigation" limit="1"}
  <nav id="classic-header" class="navbar navbar-default navbar-expand-sm" role="header" >
...
</nav>
{/exp:channel:entries}
       
DxJR's avatar
DxJR
3 posts
6 years ago
DxJR's avatar DxJR

Nevermind. I did some more intelligent searching of these here forums and found the answer. I just needed to add dynamic="no" to the channel entry tags.

       
Derek Jones's avatar
Derek Jones
7,561 posts
6 years ago
Derek Jones's avatar Derek Jones

Glad you found it DxJR! That parameter is a common gotcha, since by default the tag will try to sense your intent based on the URL.

Side note, I see your posts are getting some warnings logs, are you getting errors when trying to use the forums that I can help with?

       

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.