Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
#1 2005-12-13 08:59:54
- Kosmo
- Member
- Registered: 2005-10-06
- Posts: 22
Dynamic section and article sensitive navigation
This is a big questionmark for me. It seems complicated and it might sound like that but I try to be as clear as I can.
The idea is that we present different content in the navigation when browsing different sections of the site. But not only that, but the navigation has to show different content when browsing certain articles.
Basically this means that when I’m browsing a section called, company, the sidebar has to display links to the sub pages it has. But when I’m browsing a product page (article) we present the product image and extra content in the navigation bar.
If there is an easy way to make this happen, a plug-in for example I would be really happy, but it doesn’t matter if I have to hard code this OR make this happen with different page templates.
Which way should I go?
Offline
Re: Dynamic section and article sensitive navigation
Doesn’t sound too complicated. For the section-aware navigation, you could either have different templates for each section, or you could use a single template with a conditional statement for each section (e.g. <txp:if_section section="company">
)
For product pages, you might want to use custom fields for the extra information, using <txp:if_custom_field>
to display it.
Code is topiary
Offline
#3 2005-12-13 14:16:34
- Kosmo
- Member
- Registered: 2005-10-06
- Posts: 22
Re: Dynamic section and article sensitive navigation
Sounds reasonable enough.
I was eploring the possibility to somehow use the custom field to give a name for every product and then identify the sidebar information by the product name, like files and image. But then I hit a snag.
How I can dig up the custom field information as a variable to define what file category and image I want to present on the page? The image could be done by txp:article_image but it doesn’t display the image just a link to it.
The extra information I was talking about are files regarding the product.
Last edited by Kosmo (2005-12-13 14:17:21)
Offline
Re: Dynamic section and article sensitive navigation
How I can dig up the custom field information as a variable to define what file category and image I want to present on the page?
You can simply assign a category to each product (article) as you add it (in the content -> write tab). No need for a custom field.
The image could be done by txp:article_image but it doesn’t display the image just a link to it.
Something’s fishy here — <txp:article_image />
does indeed display the image (i.e., it outputs an <img>
tag with the src
attribute set appropriately). Check the faq on article_image.
The extra information I was talking about are files regarding the product.
A custom field might make the most sense for this.
Code is topiary
Offline