Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2009-01-19 19:32:58

alanfluff
Member
From: Ottawa, Canada
Registered: 2008-09-15
Posts: 222
Website

Using '0' as a section name: cool+safe way to hide a section from nav?

Hey fellow TXPers,

Sorry if this is documented somewhere or I am being stupid for even asking, but, I was sorting out nav on a TXP site and in the process I seem to have stumbled on a special use of 0 as a section name.

Does anyone know if using ‘0’ as a section name is supported (I am finding that it effectively removes the section from being visible, and this is brilliant since I can have that one section have one article and it is my ‘static’ homepage and it automatically does not get found in a section_list = good, no dupe urls with same content).

I am on 4.0.8 RC2.

Am totally happy to use 0 as a section name (with inherent consequences that I can use to my benefit), I just wanted to share in case this is fine to do and helpful to others or to find out from others if it is felt doing this is ‘dangerous’ (a bug that my temporary exploitation of would go in 4.0.8 or later, in which case I will not rely on it — I like the facility tho!).

Any comments welcomed, cheers -Alan


At LAST I’ve cheerfully donated to the core devs at #TXP. I only wish I were able to give more. Thanks to the devs and ALL fellow TXPers. -A

Offline

#2 2009-01-19 19:39:20

jsoo
Plugin Author
From: NC, USA
Registered: 2004-11-15
Posts: 1,793
Website

Re: Using '0' as a section name: cool+safe way to hide a section from nav?

I have a section called “hidden” for that sort of thing, with all the radio buttons in Presentation->Sections set to off. It does mean that when using <txp:section_list /> I have to manually list the sections, but as I only use that tag in one form it is no hardship.


Code is topiary

Offline

#3 2009-01-19 19:47:05

alanfluff
Member
From: Ottawa, Canada
Registered: 2008-09-15
Posts: 222
Website

Re: Using '0' as a section name: cool+safe way to hide a section from nav?

Hey J Soo, tks for that comment. I was going to do just as you have done, but always looking for ‘automation’ / lack of hard coding, where I can get it, this odd benefit seemed to good to not ask more about.

I’ll be interested to see if any Dev’s sanction it as a ‘safe’ way to have a section ‘auto-hide’.


At LAST I’ve cheerfully donated to the core devs at #TXP. I only wish I were able to give more. Thanks to the devs and ALL fellow TXPers. -A

Offline

#4 2009-01-19 19:50:25

alanfluff
Member
From: Ottawa, Canada
Registered: 2008-09-15
Posts: 222
Website

Re: Using '0' as a section name: cool+safe way to hide a section from nav?

Oops! Looks like my section_list nav just went weird on me with that section named ‘0’.

Looks like I did not test (at all) and it causes stuff to go awry – not surprising.

Conclusion: looks like using ‘0’ as a section name is NOT a safe/good thing to do. Never mind, I’ll stick to excluding it in my section_list manually.

Sorry for wasting a few KB of forum space people. Cheers, -Alan


At LAST I’ve cheerfully donated to the core devs at #TXP. I only wish I were able to give more. Thanks to the devs and ALL fellow TXPers. -A

Offline

Board footer

Powered by FluxBB