Hi Lisa,
What I am meaning here is that I don’t think it’s possible to have a single template decide itself to give fully proper activity for both Ordinary pages and Pages pages.
That was what I understood JT originally asked for, so I was trying to provide it—for his body template to work on both kinds of pages, and from the same weblog, so nothing would fundamentally change on his site.
The reason I think this is because page_uri/l aren’t available, as you found, outside the entries loop.
Thus, you have no information at the right point (at the time of calling entries) to set show_pages to the proper value. It means you would have Pages static pages showing up in the main weblog view, if you used show_pages=“yes” or left it to default, for example.
By hard-coded, I mean then that you have to have a different body template for each case—Ordinary pages or Pages pages. In JT’s structure, that also means you need to have a different main template that calls the embeds.
Both of these are very easy, and cut down on extra work.
- for the normal weblog use, you need the current structure as it is, but if you are putting static pages in the same weblog, you need to modify the current body template entries tag, just adding show_pages=“no”. That prevents the new Pages static pages from being seen and interfering there.
- to show the new Pages static pages themselves, you need a new body, which means you need a differently named copy of the index page (I use the name ‘display’ for that page). This is exactly a copy except for the name, and that it embeds a different body template - let’s call that display_body. Thus it keeps all the work on the other embeds, and is unlikely to need maintenance itself in future.
It’s this ‘display’ template that you would set the in the Pages tab as the processing template for new static pages (in the Posting screen).
In display_body, you would first of all set show_pages=“only”, so you don’t get extras and interference from ordinary pages. Probably limit=1 and the other things Lisa shows in her wolves example. Then you would alter other things you need to so the static pages show as you want.
I don’t know why at the moment JT’s present body template makes blanks for the static pages, so that’s the first thing to fix. Once that’s ok, which is no doubt something simple, then you probably just cut out features (like pagination) from what the original body had, until you have what you want for the Pages pages.
So this new display_body will end up low maintenance as well, since it’s just a simplified version of the main body template.
Ok, hope that clarifies at least the way I’m viewing it here—and in many senses, how I’m going to arrange this on my own site.
Lisa, of course you are free to criticise 😉.
Best to both of you, and I will cross-post a link,
Clive