Community

How do I print tokens inside of a theme?

Long story short, I'm wondering how one would go about printing a token inside of a theme.

I've tried various methods posted and looked through the api.

<?php
print '<li class="leaf"><a title="Latest News" href="'. drupal_get_token('[node:field-section:field-url]') .'/news">News</a></li>';
?>

This seemed to be relatively close to what I was looking for, except that the token was apprently (correctly but not desired) in a 43hex format.

The token is based upon a taxonomy field if that makes a difference.

Added:

<?php $term=taxonomy_term_load(arg(2)); ?>
<li class="leaf"><a title="Latest News" href="<?php print $term->name; ?>/news">News</a></li> ?>

Gets me a lot closer to solving this issue. I just need to figure out how to print a different field now thats in the inner nested array.
nobody click here