Hi,

I would like to display $submitted (located in page.tpl.php) only on pages which have a specific taxonomic term.
I would like to use a if statement but i don't know which variable i could use to retrieve the current term(s).

Anyone who knows how i could fix this or where i could find a list of all variables which i can use in the template?

Thx,

Carlo

Comments

agentrickard’s picture

http://drupal.org/node/11812

PHPTemplate is very well documented.

--
http://ken.blufftontoday.com/
Search first, ask good questions later.

Dublin Drupaller’s picture

Hi Carlo,

phptemplate wasn't that well documented for dummies like me, so I started a PHPTemplate Theme Snippets section in the handbook...for your needs I recommend you check this handbook page scroll to the bottom and there are a few ways of displaying information based on terms/path/node type etc. that may also be useful.

Dub

Currently in Switzerland working as an Application Developer with UBS Investment Bank...using Drupal 7 and lots of swiss chocolate

pwolanin’s picture

In PHPtemplate, at least, there is a "$terms" variable that contains all the terms formatted as links. This is how you get the clickable links on your pages that have taxonomy. See: http://drupal.org/node/46012.
You could use a regex in your node.tpl.php file to parse through $terms to decide when to display "$submitted", if you're rarely going to vary which terms you want to trigger on.

You could also, try to define a new variable, such as at http://drupal.org/node/16383, or define a new function elsewhere (a small custom module) to do an SQL query to get the node's terms and compare those to a list of terms to use as triggers.

One hackish (but relatively easy) way to do this could also be to have a "master" node (even unpublished) which you tag with all the terms you want to have trigger the display of "$submitted". Then run a query to compare your node's tags to your "master" node. Or use the built-in functions to get the terms like in http://drupal.org/node/16383#comment-45360.

---
Work: BioRAFT

pwolanin’s picture

I just came across this module:

http://drupal.org/project/taxonomy_theme

Looks like a short-cut to the functionality you want:

If you need to apply different themes for certain node types, you can use
'NodeType-based' selection method.

---
Work: BioRAFT