Taxonomy terms in page.tpl.php
function YourThemeName_preprocess_page(&$variables) { foreach($variables['node']->taxonomy AS $tax_term) { $variables['wowzers'] .= ", $tax_term->name"; } $variables['wowzers'] = substr($variables['wowzers'],1); }
After entering this in your template.php file the variable $wowzers will be availble for use within your page.tpl.php file.
Please note you can only use one preprocess function per template.tpl.php file.
Taxonomy terms in page.tpl.php
Within your page.tpl.php file enter the following:
if (arg(0) == 'node' && is_numeric(arg(1)) && !arg(2)) { $node = node_load(arg(1)); $taxonomy_terms = $node->taxonomy; foreach ($taxonomy_terms as $term) { $faq_tags .= ", $term->name"; } } $faq_tags = substr($faq_tags,1); print $faq_tags;
Taxonomy terms in contemplate template.
Enter the following within your customised template.
<? $taxonomy_terms = $node->taxonomy; foreach ($taxonomy_terms as $term) { $faq_tags .= ", $term->name"; } $faq_tags = substr($faq_tags,1); ?>
The variable $faq_tags is now available listing the terms separated by commas.
Custom filter for the Drupal View’s Module
These might help:
Base href
You can set the base href from the default to the required. For example assume the following HTML code is included.
<base href="http://beamish/flat/sIFR/" />
Thereafter all references would precede with: http://beamish/flat/sIFR/
Therefore:
<script src="https://www.zerotouch.com/sifr.js">http://www.zerotouch.com/sifr.js" type="text/javascript"></script>
http://www.zerotouch.com/sifr.js" type="text/javascript">
Garland secondary-links wrapping in IE
Within the Garland theme the secondary links have a bug in that they wrap. A quick fix is to change page.tpl.php as follows:
- <?php print theme('links', $secondary_links, array('class' => 'links secondary-links')) ?> + <?php print theme('links', $secondary_links, array('class' => 'links secondary-links')) ?>
Collapse the menu fieldset by default
Within your template.php file enter the following:
function yourthemename_node_form($form) { // Collapse fieldsets $form_elements = element_children($form); foreach ($form_elements as $element) { if ($form[$element]['#type'] == 'fieldset') { //Identify fieldsets and collapse them $form[$element]['#collapsible'] = TRUE; $form[$element]['#collapsed'] = TRUE; } } return drupal_render($form); }
Order View as per Menu Order
This can be easily achieved using the views_menu_sort module. Whilst this is not an officially contributed module is can be obtained via:
http://drupal.org/node/313140 (see item #8)
Or directly download the zip file at: