Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2008-01-31 20:06:28

mauricenaef
Member
Registered: 2008-01-31
Posts: 23

Asign subpage different Page (Layout)

Hi there

I’m pretty new to textpattern and so far really enjoy learning it.
There is one point thou which I still don’t quite get and am really confused about! Page organisation.

Im building a website where I have following Sitemap

  • Home
  • About * * us * * products * * work
  • Stuff * * p1 * * p2
  • Contact
  • Blog

Now I have found out that I have to use Sections for the main level (Home, About, Stuff…) and articles for the sublevel (us, products,..)
But, heres the thing, how do I asign a specific page template to lets say the us or p1 section???

I really dont understand that and would apreciate some help desperatly!
Thank you all and kind regards

Last edited by mauricenaef (2008-01-31 20:09:02)

Offline

#2 2008-01-31 20:54:48

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

Re: Asign subpage different Page (Layout)

If you just need small variations like a different colour scheme you could do something like this:

<body>
<txp:if_section name="about,stuff,contact">
<txp:if_individual_article>
<div id="subwrap">
<txp:else />
<div id="mainwrap">
</txp:if_individual_article>
</txp:if_section>
....(the rest of your page)
</div>
</body>

Or if you need a completely different layout you can put your page templates in (misc) forms, and call them on the page like this:

<txp:if_section name="about,stuff,contact">
<txp:if_individual_article>
<txp:output_form form="sub_page" />
<txp:else />
<txp:output_form form="main_page" />
</txp:if_individual_article>
</txp:if_section>

And/or use the conditional tags for linking to different style sheets. And there are probably even more ways to do it ;)

Last edited by els (2008-01-31 20:56:26)

Offline

#3 2008-01-31 21:12:51

mauricenaef
Member
Registered: 2008-01-31
Posts: 23

Re: Asign subpage different Page (Layout)

Hello Els

Thanks for the fast reply.

Isn’t this the same es aplying a template to a section in the sections tab?
What I need is a possibility to give the articles (my subsection) a different design. Would I be able to do this the same way?
thanks for your help :-)

Maurice

Offline

#4 2008-01-31 22:22:10

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

Re: Asign subpage different Page (Layout)

You can only assign pages to sections, not to articles or categories. So if your about section uses a particular page template, then the individual articles in that section will use that as well. A workaround is to create a different page template in a form, like in my second example. The simplest way is to copy an existing page to an external editor (because the text area of forms is rather small), modify it, and paste it into a form. Then in the ‘about’ page template put something like this:

<txp:if_individual_article>
<txp:output_form form="sub_page" />
<txp:else />
... (your code for the 'main' page here) ...
</txp:if_individual_article>

Last edited by els (2008-01-31 22:23:02)

Offline

#5 2008-07-18 08:00:30

gomedia
Plugin Author
Registered: 2008-06-01
Posts: 1,373

Re: Asign subpage different Page (Layout)

If you require a menu based purely on sections and sub-sections have a look at my plugin: adi_menu.

Offline

Board footer

Powered by FluxBB