[support] page titles for views?

sander-martijn lists at severeddreams.com
Mon Oct 1 22:43:40 UTC 2007


Anyone have an idea how to do this? I still haven't figured it out.

thanks
.sander

sander-martijn wrote:
> Does anyone know a way to customize the page title (in the title tag) 
> for a view?  I asked about this for pages earlier and Bill suggested
> the page title module which works great - but there are two top level 
> pages that are views that I need to customize the titles for and the 
> page title module doesn't work with views.  Since it's only two pages 
> and the title isn't likely to change or at least not often I'm even 
> willing to hard code it into template.php. what i tried so far is to add 
> the following function to _phptemplate_variables:
> 
> if($vars['node']->nid == '12'){
>   $vars['head_title'] = "TEST";
> }
> 
> 
> I verified (through print statements) that the statement gets triggered 
> on the proper page and that $vars['head_title'] is printing the current 
> title.  Furthermore a similar function is how the page title module does 
> it.  Yet when I print out the variable immediately after the function it 
> still stays what it was.  Full with print statements and output:
> 
> print($vars['head_title']); // prints: Photo Gallery | Timberpeg
> if($vars['node']->nid == '12'){
>   print(" changing to test "); // prints: changing to test - indicates 
> it gets triggered
>   $vars['head_title'] = "TEST";
> }
> print($vars['head_title']); // prints: Photo Gallery | Timberpeg
> 
> thanks
> .sander


More information about the support mailing list