Page 1 of 1

ID for body tag

Posted: Thu 21. Sep 2006, 14:59
by Oldboy
Hi folks,
is it possible to write the current page ID into the body tag?

EXAMPLE:

Current Page: index.php?testpage

Body tag: <body id="testpage">

Greetings,
Oldboy.

yes

Posted: Wed 25. Oct 2006, 14:30
by Ren.Hoek
I have no doubt that this is possible,

- you would have to insert this into the code (php-scripts)
- you have to check out which is the phpwcms-variable for the id
OR
- you truncate the URL also using PHP (also in the source code)

Hope this gives you a starting point - I'm a bit lazy today...

Greetings, Ren

Posted: Wed 25. Oct 2006, 14:42
by juergen
Hi

try this (in template section)

Code: Select all

[PHP]
if(isset($GLOBALS['LEVEL_ID'][1])) {
$level_id = $GLOBALS['LEVEL_ID'][1];
$name= $GLOBALS['LEVEL_STRUCT'][$GLOBALS['LEVEL_KEY'][$level_id]];
echo '<body id="'.$name. '">' ;
}
[/PHP]
Never tested, should work :oops:

//edit:

ARGGSS... this should happen in HTML Head ...

Jürgen

script

Posted: Wed 25. Oct 2006, 14:55
by Ren.Hoek
Hi,

I _guess_ you need to change the index.php around the lines containing

Code: Select all

$content['page_start']
Use the variables above ;-)

Cheers, Ren