This is really foxing me. I've got a single 'layout' template that is called as a wrapper by all my other 'content' templates (i.e. {layout="layouts/_general_layout"}). Part of the layout template provides the main navigation; three items in that navigation have sub-menus (which are just unordered lists). The list items inside those ULs are generated dynamically, from channel entry data. It all works fine for every 'content' template… except three.
When these three templates (let's call them The Problems) call the layout, one or more of the navigation sub-menus in the layout do not get generated. The <ul>s are left empty. Exactly which of the three <ul>s get missed is different for each of the Problems.
What is perplexing me is that I can only think of two ways in which the content template can affect the output of the layout template: layout variables (either as a parameter or via the {layout:set} tag, or by having conditionals in the layout that vary things according to the URL segments.
I do have some layout variables artwork in my content templates, but they only act to set meta tags for SEO. And there are no segment-checking conditionals around the missing dynamically-generated submenus.
The missing content is actually missing, not just hidden with CSS. Turning javascript off makes no difference. I've even commented out EVERYTHING inside the ‘Problem’ content templates except for the {layout="layouts/_general_layout"} tag (and removed the layout variable parameters for good measure) and the issue persists. So presumably the issue lies in the layout itself, but I absolutely cannot see the problem, since it works perfectly for every other content template.
As additional info, let me say that all three Problems are part of the same template group: news/year, news/month, and news/article. However, news/index does not trigger the problem — that one works just fine.
So: Can anybody suggest what other factors (other than segment-based conditionals and layout variables) might cause a layout to miss out/not parse chunks only when called by specific content templates?
(I'l post template code if required, but that might mean quite a bit of code, so I thought I'd ask without it first).