Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Default section title in 4.07 not displaying
I’m having trouble getting <txp:section title="1" wraptag="h1" /> to display the home page title. I have a a section “home” that is the selected as the shown on the front page, with every other section not shown on the front page.
http://webtemp2.paulbunyan.net/
The title for the sections show on every section but the home section. This worked in 4.06, how come this is broken in 4.07? thanks!
-Nate
Offline
Re: Default section title in 4.07 not displaying
Multiple section can be selected to show on the front page (this didn’t change in 4.0.6), so you’ll have to use something like this instead:
<h1><txp:if_section><txp:section title="1" /><txp:else />Home</txp:if_section></h1>
Offline
Re: Default section title in 4.07 not displaying
With that it displays only “Home” for the section title on each section, and Default still comes up blank. Looking at the source, textpattern renders the title for Default as <h1> </h1>. So it’s grabbing my styles for H1, but not the title…..arg.
Offline
Re: Default section title in 4.07 not displaying
Try this one:
<h1><txp:if_section name="">Home<txp:else /><txp:section title="1" /></txp:if_section></h1>
Offline
Re: Default section title in 4.07 not displaying
sweet that seemed to work.
So in 4.07 you can’t use a sections title, like “Home”, that is marked as being on the front page apparently. How come that changed? There are a few other quarky things that changed in 4.07 from 4.06 that i have gripes about…
Offline
#6 2008-12-19 17:42:22
- els
- Moderator

- From: The Netherlands
- Registered: 2004-06-06
- Posts: 7,458
Re: Default section title in 4.07 not displaying
Hmm… the difference I notice is that on the front page <txp:section title="1" /> displays default in 4.0.6, and in 4.0.7 it displays nothing. What I don’t understand is how it could have displayed Home on your site, because you can’t assign a section title to the default section (because it’s not a real section)…
Offline
Re: Default section title in 4.07 not displaying
oh ya, i forgot I had to do a if else for the title on the default pages…your right. but it at least displayed “something” in 4.06,now it just displays blank in the default section.
Offline
#8 2008-12-19 21:47:55
- els
- Moderator

- From: The Netherlands
- Registered: 2004-06-06
- Posts: 7,458
Re: Default section title in 4.07 not displaying
ecklesroad wrote:
now it just displays blank in the default section.
Which seems an improvement to me, why would anyone want to display ‘default’? ;)
Offline
Re: Default section title in 4.07 not displaying
I would assume someone would want to use the section title from the section that is marked to be on the front page. Guess it doesn’t work that way.
Offline
Re: Default section title in 4.07 not displaying
ecklesroad wrote:
I would assume someone would want to use the section title from the section that is marked to be on the front page. Guess it doesn’t work that way.
Multiple sections can be marked to appear on the front page
Piwik Dashboard, Google Analytics Dashboard, Minibar, Article Image Colorpicker, Admin Datepicker, Admin Google Map, Admin Colorpicker
Offline
Re: Default section title in 4.07 not displaying
Thanks guys for your help!
Offline
Re: Default section title in 4.07 not displaying
Huh? So this doesn’t work:
<h1><txp:if_section><txp:section title="1" /><txp:else />Home</txp:if_section></h1>
And this DOES work?
<h1><txp:if_section name="">Home<txp:else /><txp:section title="1" /></txp:if_section></h1>
Both should give exactly the same result, because the name attribute defaults to an empty string if not explicitly specified.
Offline
Re: Default section title in 4.07 not displaying
apparently.
from textbook:
name=“section” Comma-separated list of section names.
For the default section, either use the text default or a single comma (for example, both name=”, other_section” and name=“default, other_section” are equivalent).
Last edited by ecklesroad (2008-12-20 15:06:53)
Offline
#14 2008-12-20 16:08:28
- els
- Moderator

- From: The Netherlands
- Registered: 2004-06-06
- Posts: 7,458
Re: Default section title in 4.07 not displaying
ruud wrote:
Huh? So this doesn’t work:
<h1><txp:if_section><txp:section title="1" /><txp:else />Home</txp:if_section></h1>
I can confirm this. In my test install it displays nothing on the front page, and ‘Home’ on every section page…
Offline
Re: Default section title in 4.07 not displaying
Els wrote:
<h1><txp:if_section><txp:section title=“1” /><txp:else />Home</txp:if_section></h1>
Well I’m officially confused now! Despite what Textbook says I thought that <txp:if_section> (with no attribute) would return true if we were on some (any) section at all — as opposed to the front page, which is sectionless. Rather like how <txp:if_category /> will return true if any category is being viewed and false if we’re somewhere else. That behaviour supports the above snippet.
Conversely, if you explicitly stated <txp:if_section name="" /> or <txp:if_section name="default" /> then it should return true for the front page and false for other pages that have an actual section. And of course <txp:if_section name="my_section" /> returns true only for that section.
That’s how my twisted logic expects it to work anyway…
Last edited by Bloke (2008-12-20 16:22:44)
The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.
Hire Txp Builders – finely-crafted code, design and Txp
Offline