Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
#1 2005-12-02 12:58:11
- saccade
- Plugin Author
- From: Neubeuern, Germany
- Registered: 2004-11-05
- Posts: 521
Category Pages linked to a specific page template other than Default?
Hello,
I have a question about category pages and templates:
Out of the box ‘category pages’ are linked to the ‘page template’ which is linked to the ‘default section’ which is hardcoded used for the home page.
My problem is the following:
I have several sections as parts of my menu-first-level, and categories (category pages) as menu-second-level.
Everything was fine until I needed to change the home page:
I switched the page template for the default section to a customized template with a fixed content.
Sections are still ok (all of them using the former default template).
But my sub-menues not longer show category pages but the home page!
There is no difference if I use the Browse-Popup or my hardcoded navigation menu.
Category pages seem to be hard linked to the page template which is used by the default section.
But I want to have a different page template (different from the default section) for the category pages (in this case the default template for all my other sections).
Is there any way to change the page template for category pages?
Here I found a way for the Browse-popup and maybe it will function for my hardcoded navigation (MySite/category/categoryName) too.
But isn’t there any way to link a default page template to category pages in the administrators settings?
PS: Of course I also could set an if_category-Tag on the homepage/defaultsection-pagetemplate – but wouldn’t it be easier to use separate page templates?
Thank you for any help!
Offline
Re: Category Pages linked to a specific page template other than Default?
Have a look at this.
Stuart
In a Time of Universal Deceit
Telling the Truth is Revolutionary.
Offline
#3 2005-12-02 13:36:58
- saccade
- Plugin Author
- From: Neubeuern, Germany
- Registered: 2004-11-05
- Posts: 521
Re: Category Pages linked to a specific page template other than Default?
Thank you very much – very helpful!
So I can manage to have the right (and even different for different sections!) template for each category list.
I replaced my fully hardcoded navigation by the following semi-hardcoded:
<code><a href=”<txp:site_url /><txp:section />/?c=categoryName”>categoryName</a></code>
BUT:
As I have the sub-menues of my navigation on the homepage too, that will work only if I go to a section before ans call my category pages from within a section.
If I want to go from the homepage directly to a submenu/category page, I stick to the default-section-template which initially doesn’t allow article lists.
At the moment I’m working well with an if_category-tag on the homepage, but you are right: with more complicated content that would be a ba pain in …
SO:
will there be any way to have direct control over which template will be used ba a category-page-call?
best regards
Michael
Last edited by saccade (2005-12-02 13:46:44)
Offline
Re: Category Pages linked to a specific page template other than Default?
The code I pointed you to was designed to replace the normal <code><txp:category1 /></code> tags usually used within an article thus anyone clicking on those links would already be within the section. As you wish to use this in a menu could I suggest you don’t show those parts of the menu unless you are in the section? You could do this by surrounding the appropriate code blocks with the <code><txp:if_section name=“sectionName”><txp:else /></txp:if_section></code> tags. I actually do something similar on my own site though it isn’t to do with categories but I have a top level menu which remains constant and a second level menu which changes according to where you are in the site.
Last edited by thebombsite (2005-12-02 13:56:32)
Stuart
In a Time of Universal Deceit
Telling the Truth is Revolutionary.
Offline