Loading...
 
Skip to main content

Themes


Display different banner or image according to a pages category

We would like to display a different header image in different parts of a site. This could either be from a different image or banner link in the tiki-top_bar.tpl We have experimented with an If statement which determines the correct image to be displayed according to the category assigned to each page. We haven't been able to find the correct syntax to do this. Can someone please let us know the syntax for querying a pages category or let us know if there is a better way of achieving the same result. We are using v1.9.7

To check if a page is categorized, use:

Copy to clipboard
{$is_categorized eq 'y'} ... {/if}


In the template, the category is shown as its full path:

Copy to clipboard
{$display_catpath}


You might be able to use checks against these items. However, you may need to do this in tiki-show_page — not tiki-top_bar.

HTH,

-RickQuestion
Coming soon: TikiWiki for Dummies Smarties — A beginner's guide to using ))TikiWiki((.


> We would like to display a different header image in different parts of a site. This could either be from a different image or banner link in the tiki-top_bar.tpl We have experimented with an If statement which determines the correct image to be displayed according to the category assigned to each page. We haven't been able to find the correct syntax to do this. Can someone please let us know the syntax for querying a pages category or let us know if there is a better way of achieving the same result. We are using v1.9.7