How to get parent and current forum titles

« Back :: Tagged with Drupal :: Drupal 6.x :: HowTo's :: PHP :: Snippets ::

How to get prevous forum and current forum titles in template files.

 In, for example, forum-topic-list.tpl.php you can get the title of the preceeding forum and current forum like this:

<?php
  // Get parent forum
  $parent = taxonomy_get_parents(arg(1));
  // Get current forum
  $term = taxonomy_get_term(arg(1));      
  // Set title
  drupal_set_title($parent[key($parent)]->name.': '.$term->name);
?>

Comments

Anonymous @ May 6th, 2011 - 21:09

det var mycket intressant att läsa. Jag vill citera ditt inlägg i min blogg. Det kan? Och du et ett konto på Twitter?

Post new comment

The content of this field is kept private and will not be shown publicly.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <blockquote> <blockcode> <pre> <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.

More information about formatting options

Copyright © 2010 deuxcode.com
Powered by Drupal. Valid XHTML 1.0 Strict and CSS 2.1.