Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2006-10-10 06:43:09

mwillse
Member
From: brooklyn, ny
Registered: 2006-06-26
Posts: 83
Website

quirk with uppercase in <txp:section />

Tonight, without thinking much about it, I created a new section for a client called “nextTen”. The site broke and I dug around to figure out why. It seemed that <txp:if_section name="nextTen" > worked on one page, but not another. But both pages used the same page template and form!

I figured that the it was a case-sensitive issue.
But wondered: why would it work for one, but not the other?

I often use <body class="<txp:section />" > so that I can declare a style with something like body#about or body#archive. I noticed that one page had <body class="nextTen" >, but the other was <body class="nextten" >. Odd. Again, this html came from the same page template. I added another article and things became more clear, but no less quirky.

All single articles worked, and had <body class="nextTen" >.

Viewing the section however, whatever.org/nextTen/ had a class of in all lowercase. I wasn’t displaying a list of articles, but instead a single sticky artilce using if statements. I figure that as a list, <txp:section /> was grabbing the section title instead of name, or vice-versa. But nope. I declared title="0" and still, the same page template spit out the section name differently. Lowercase for a list, mixed-case for single article. Strange!

Anyhow. I thought I’d share this for anyone who might be snagged by this quirk.

Offline

#2 2006-10-15 21:13:08

1beb
Plugin Author
From: Canada, Ontario, Toronto
Registered: 2004-11-22
Posts: 169
Website

Re: quirk with uppercase in <txp:section />

In the Prestentation->Sections page you can specify a title for the section and a name the title is used for display purposes and the name is used within textpattern. Perhaps you should change the name to all lower case and the title to the other. Then your txp:section variable would drop the lower case version.

Best practice is to use lower case letters always. I’ve had a similar problem before.

Offline

#3 2007-02-12 05:14:54

utamu
Member
From: upstate NY, USA
Registered: 2006-12-05
Posts: 20

Re: quirk with uppercase in <txp:section />

oh my damn.

I just spent the last 8 hours agonizing over random 404 errors all because I named my sections “Blog” “About”, etc. I even reinstalled TXP.

The stupid little mistakes are always the worst, that’s what I get for neglecting the forums for so long.

I love you guys :(

*commits seppuku*

Last edited by utamu (2007-02-12 05:16:33)

Offline

Board footer

Powered by FluxBB