Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2009-02-03 22:37:25

shagwana
New Member
From: UK
Registered: 2009-02-03
Posts: 9
Website

Force change the current section

Is there a way to make textpattern think its in a different section then the one its in?

The reason I want to do this, is make my homepage/default page show content from a certain section on the front page without having to make all my reusable forms check to see if its in the default section.

Offline

#2 2009-02-04 17:52:08

shagwana
New Member
From: UK
Registered: 2009-02-03
Posts: 9
Website

Re: Force change the current section

Well I have a solution thats not ideal, i used a html redirect on my website section i wished to be shown on the front page.

Another soultion would be to use a varible, to reference the section, then set the value of the varible on the pages. Tiny little amount more overhead per a form, but not to much.

What I think would be the ideal way, is to give the users the function like <txp:change_section id=“about”>. Then anything there after will think its in the ‘about’ section.

Offline

#3 2009-02-04 18:43:09

nabrown78
Member
From: Northampton, MA, USA
Registered: 2006-10-04
Posts: 294
Website

Re: Force change the current section

Hm…I don’t get it. Why is selecting “show on front page” on the Sections tab insufficient? Are you applying different styles or layout to the front page, but for these articles you want to show the styling they have when they’re in there own section? <txp:if_section name="default"> can’t be too much overhead.

Offline

#4 2009-02-04 19:54:29

els
Moderator
From: The Netherlands
Registered: 2004-06-06
Posts: 7,458

Re: Force change the current section

shagwana wrote:

make my homepage/default page show content from a certain section on the front page

What’s wrong with <txp:article_custom section="yoursection" />?

Offline

#5 2009-02-04 22:30:16

shagwana
New Member
From: UK
Registered: 2009-02-03
Posts: 9
Website

Re: Force change the current section

I am not using article_custom by hard coding it, i am using it like:

<txp:article_custom section=’<txp:section />’>

wrapped up in a form called section-posts. Then that reusable chunk is used on different pages via the old output form command. Now, when ever I want to alter the look of posts across the site, I now have only one place to look. For example, I want to alter the postion of the date in the output.

Another reason for changing the section is so the section_list based nav menu works automagicly. Without the need to add the ‘default’ menu option. Not eveyone wants a home page!.

Offline

#6 2009-02-04 23:11:00

els
Moderator
From: The Netherlands
Registered: 2004-06-06
Posts: 7,458

Re: Force change the current section

Sorry, you’ve lost me…

Offline

Board footer

Powered by FluxBB