0

I've got an embedded template called _sidebar that contains (surprise surprise) the site's sidebar content. It contains a heading and a channel:entries tag, all wrapped in a container div. In some templates (eg. the index template of the 'news' template group) the C:E tag works as expected. However, when I embed _sidebar into the news/view template *and access a particular news article via a {url_title_path} link* the C:E tag fails to generate any content.

However, I can see that _sidebar is getting embedded, because the heading and the container div appear in the sidebar region as expected. It's just that none of the content that should be called in by the C:E tag is there.

Both the 'news' and 'news/view' host templates have identical structures. There are no nested C:E tags either in the host template or in the embedded template. If I go to the URL domain.com/news/view (without selecting a specific article) then the sidebar displays correctly. It is only when the same template is used for a specific article (e.g.. domain.com/news/view/my-article-title that the glitch occurs.

BTW, I have no conditionals relating to segment_3 in my templates. There are some conditionals acting on the value of segment_1 in the _sidebar template, but if they were being triggered then the heading and container div would be removed from the template also.

I'm a bit stumped. Without getting into the whole template code (yet) does anyone have any immediate thoughts, or has anyone run across this phenomena?

0

Semi-educated guess: You need to set dynamic="no" on the channel entries tag. If that's not the issue then I'd suggest posting some template code so that people can see what's going on.

| improve this answer | |
  • Oh my god. I can’t believe that I fell over the old Dynamic="no" step. That was it. Thanks. Puts rookie hat back on – RickL Mar 19 '13 at 16:10
  • Ha, no worries. We've all done it at some point. – Dom Stubbs Mar 19 '13 at 16:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.