Hi folks,
can anyone tell me how I can tell what page is being displayed from within page.tpl.php?

thanks
Selwyn

Comments

vm’s picture

The front page.

selwynpolit’s picture

It seems like this script gets run every time a page is displayed, not only the front page.

greg@beargroup.com’s picture

Do you mean what node type is being displayed? Can add something like this to the head area:

<meta name="keywords" content=" <?php print $node->type ?>  "></meta> 

Then view source.

selwynpolit’s picture

Sort of. If the page "about" is being displayed in this pass through page.tpl.php, then I want to do something. If the page "mission" is being displayed then I want to do something different. It looks like I could use $title. Is there perhaps a better way, or is that the proscribed way?

thanks for your help.
Selwyn

Well, I got it... If anyone is interested, this is what I did (with help) ...

	$uri_request_id = $_SERVER['REQUEST_URI'];
	$pg_array = explode("/", $uri_request_id);

	if ($pg_array[1] == "about")
	{
		echo "<td><a href=\"/about\" onMouseOut=\"document.om_about.src ...
		echo "<img name=\"om_about\" src=\"/images/om_about_f2.gif\" ...
	}
	else
	{
		echo "<td><a href=\"/about\" onMouseOut=\"document.om_about.src = ...
		echo "<img name=\"om_about\" src=\"/images/om_about.gif\" width=\"110\"...
	}

This was all about making graphic menus sticky..