Hey,

I'm really starting to love the possibilities content template has opened up for me, but in the midst of playing around with the output of the teaser and body content, I notice I can't seem to access the title at all or control the output in any capacity. Is there any way to update the $title output through contemplate? That would save me alot of trouble trying to configure automatic node titles because it's having a problem getting the current taxonomy term.

Any help would be appreciated.

Thanks!

Comments

jrglasgow’s picture

Status: Active » Postponed (maintainer needs more info)

The title is set before contemplate gets invoked. You can over write the title by invoking the drupal_set_title() function.

Does this answer your question?

rc2020’s picture

Yeah it does, thanks.

I also wrote a node-type.tpl.php file, which sets the $title in addition to content templates, so I can use both interchangably, but its kind of an ugly fix...

philbar’s picture

Version: 5.x-2.04 » 6.x-1.x-dev
Category: support » feature
Status: Postponed (maintainer needs more info) » Active

I would also like this functionality.

I'm trying to append an icon to the title of specific content types. It would be awesome if I could do it with Contemplate rather than having to dig into the theme code.

Marking as a "feature request" and activating.

jrglasgow’s picture

it is easy enough to do with contemplate currently, just use the drupal_set_title() function mentioned in #1

philbar’s picture

I'm a novice when it comes to drupal code. Can you show me an example of how to use drupal_set_title() function?

I would like to take the title, and wrap it in a link.

So the title changes from NODE_TITLE to <a href="URL">NODE_TITLE</a>.

Thanks in advance.

jrglasgow’s picture

something like this

drupal_set_title('<a href="'. $url .'">'. $node->title .'</a>');
iantresman’s picture

I guess that if you wanted to change the position of a node's title, you could use CSS and set display:none, and then output it wherever you wanted with $node->title.