Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#13 2008-12-20 15:03:03

ecklesroad
Plugin Author
From: Bemidji, MN
Registered: 2008-02-22
Posts: 119
Website

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

#15 2008-12-20 16:21:19

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,279
Website GitHub

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

#16 2008-12-20 16:58:26

wet
Developer Emeritus
From: Schoerfling, Austria
Registered: 2005-06-06
Posts: 3,324
Website Mastodon

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

#18 2008-12-20 19:17:42

ruud
Developer Emeritus
From: a galaxy far far away
Registered: 2006-06-04
Posts: 5,068
Website

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

#19 2008-12-20 19:22:03

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,279
Website GitHub

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

#21 2008-12-20 20:25:15

ruud
Developer Emeritus
From: a galaxy far far away
Registered: 2006-06-04
Posts: 5,068
Website

Re: Default section title in 4.07 not displaying

The frontpage is both category-less and section-less.

Offline

#22 2008-12-20 20:26:50

ecklesroad
Plugin Author
From: Bemidji, MN
Registered: 2008-02-22
Posts: 119
Website

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

#23 2008-12-21 07:51:28

wet
Developer Emeritus
From: Schoerfling, Austria
Registered: 2005-06-06
Posts: 3,324
Website Mastodon

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

#24 2008-12-21 16:09:23

ecklesroad
Plugin Author
From: Bemidji, MN
Registered: 2008-02-22
Posts: 119
Website

Re: Default section title in 4.07 not displaying

ya, that just how I roll.

Offline

Board footer

Powered by FluxBB