Doesn't look like that will work. It seems to only allow you to edit the header. I think it executes this php code fairly late in the game (although I'm not positive about this). The only data I can even get into there is using global $current_view; print_r($current_view); but nothing related to the title there. Also editing any variables doesn't seem to have an affect outside of the realm of the header area.
thanks for the idea though - that would have been pretty slick. .s
Bill Fitzgerald wrote:
I don't know if this would work, as I haven't tried this yet, so, take this for what it's worth.
Which ain't much...
How about a function in template.php that would grab a title generated from some php in the view header?
This way, it would Just Work in any view, and you wouldn't need to hardcode anything --
Cheers,
Bill
sander-martijn wrote:
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