ID for body tag

Get help with installation and running phpwcms here. Please do not post bug reports or feature requests here.
Post Reply
Oldboy
Posts: 85
Joined: Mon 18. Sep 2006, 15:13

ID for body tag

Post 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.
Ren.Hoek
Posts: 34
Joined: Thu 3. Mar 2005, 21:38
Location: Augsburg/Germany
Contact:

yes

Post 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
User avatar
juergen
Moderator
Posts: 4556
Joined: Mon 10. Jan 2005, 18:10
Location: Weinheim
Contact:

Post 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
Ren.Hoek
Posts: 34
Joined: Thu 3. Mar 2005, 21:38
Location: Augsburg/Germany
Contact:

script

Post 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
Post Reply