Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
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.
Txp Builders – finely-crafted code, design and Txp
Online
Re: Default section title in 4.07 not displaying
Els wrote:
ecklesroad wrote:
> now it just displays blank in the default section.
Which seems an improvement to me, why would anyone want to display ‘default’? ;)
Exactly, this is what was intended with r2919. This changeset was part of 4.0.7.
Offline
#17 2008-12-20 19:08:44
- els
- Moderator
- From: The Netherlands
- Registered: 2004-06-06
- Posts: 7,458
Re: Default section title in 4.07 not displaying
Bloke wrote:
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.
That’s exactly what I thought, but now that I think about it, I knew of course that <txp:if_section name="">
means if not in any section, and that <txp:if_category name="">
means if in any category. The default value of the name
attribute for both tags is empty. So yes, these two tags show opposite behaviours… and that is quite confusing indeed!
Offline
Re: Default section title in 4.07 not displaying
To me it would make sense to do this if you mean any category or any section (simply leave out the name attribute):
<txp:if_category>
<txp:if_section>
Offline
Re: Default section title in 4.07 not displaying
ruud wrote:
To me it would make sense to do this if you mean any category or any section (simply leave out the name attribute)
Agreed. And that would exclude the section-less front page? So <txp:if_section>
is true for all pages except the front page?
The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.
Txp Builders – finely-crafted code, design and Txp
Online
#20 2008-12-20 19:32:42
- els
- Moderator
- From: The Netherlands
- Registered: 2004-06-06
- Posts: 7,458
Re: Default section title in 4.07 not displaying
ruud wrote:
To me it would make sense to do this if you mean any category or any section (simply leave out the name attribute)
+ 1.
Bloke wrote:
Agreed. And that would exclude the section-less front page?
I like that question :)))
Offline
Re: Default section title in 4.07 not displaying
The frontpage is both category-less and section-less.
Offline
Re: Default section title in 4.07 not displaying
I guess when ever I set up a site in textpattern there’s only one section on the front page (“home”). It would be nice somehow for that front page to grab the section title from that one section tagged as on front page, but this way works too.
I stirred up a bees nest.
Offline
Re: Default section title in 4.07 not displaying
ecklesroad wrote:
I guess when ever I set up a site in textpattern there’s only one section on the front page (“home”).
The assumption of this being a general practise is false.
Offline
Re: Default section title in 4.07 not displaying
ya, that just how I roll.
Offline