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

Template Partial does not work on a single-entry page

Development and Programming

obadoba's avatar
obadoba
2 posts
2 years ago
obadoba's avatar obadoba

Hi All,

I have a few channels for my website, the main channel (channel1) and another channel (channel2).

I’m using a sidebar in my channel1 templates which shows the titles of channel2. I set up the sidebar in a Template Partial.

The Partial displays the titles fine on the index-page of channel1 (where a number of entries are shown) but does not display on a single-entry-page (where just one entry of the channel1 is shown).

I tried using an embedded template with the titles of channel2 as sidebar. It displays fine by itself and displays fine on the index-page, but also does not display the titles on the single-entry-page.

Why does my Partial or the embedded template not display on the single-entry-page?

The Partial looks like this:

{exp:channel:entries channel="channel2" category="4" sort="desc" limit="5" disable="member_data|trackbacks"}
<div>{title}</div>
{/exp:channel:entries}

I use it on the index-page like this:

<div id="sidebar">
{template}
</div>
{exp:channel:entries channel="channel1" sort="desc" limit="5" disable="member_data|trackbacks"}
<div><a href="{title_permalink=channel1/single}">{title}</div>
{/exp:channel:entries}

I use it on the single-entry-page like this:

<div id="sidebar">
{template}
</div>
{exp:channel:entries channel="channel1" limit="1" disable="member_data|trackbacks"}
<div>{title}</div>
{/exp:channel:entries}

Any hints why this is not working as exprected are very appreciated!

Cheers, Andrea

       
Rob Allen's avatar
Rob Allen
3,105 posts
2 years ago
Rob Allen's avatar Rob Allen

In your partial entries tag add the parameter dynamic=”no”…

{exp:channel:entries channel="channel2" category="4" sort="desc" limit="5" disable="member_data|trackbacks" dynamic="no"}
<div>{title}</div>
{/exp:channel:entries}
       
obadoba's avatar
obadoba
2 posts
2 years ago
obadoba's avatar obadoba

That did the trick 😊 Thank you so very much, this cost me me hours and hours of headache.

       

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.