1
brentw
changing header for different pages?
  • 2005/6/14 20:00

  • brentw

  • Just popping in

  • Posts: 18

  • Since: 2005/5/25


Hello all.

I want to display different headers on my website depending upon where the user is. If the user is on the "top page", I have a large graphical header. Otherwise, I want a smaller header in order to maximize the space available for the loaded pages (modules).

How do I determine the "visibility" of the current page from within my custom theme.html file?


Thanks!

Brent Weatherly

2
wcrwcr
Re: changing header for different pages?
  • 2005/6/14 20:16

  • wcrwcr

  • Home away from home

  • Posts: 1114

  • Since: 2003/12/12


Hi

I guess that this is almost what you need:

https://xoops.org/modules/news/article.php?storyid=2271&com_id=17384&com_rootid=17263&com_mode=thread&#comment17384

Take a look on the changing header code and maybe you could adapt it to your needs

hope this helps

3
brentw
Re: changing header for different pages?
  • 2005/6/14 21:04

  • brentw

  • Just popping in

  • Posts: 18

  • Since: 2005/5/25


Hmmm...not sure. Though the header changes, technically it seems that the behavior is the same no matter where you are.

When setting up blocks, you have to select whether you want a block to be visible in: Top, All, etc. Somewhere XOOPs determines what page is being rendered and sets the visibility style of a block depending on that variable. Essentially, I want to be able to do this same sort of thing statically from the theme.html file (presumably using a <{$xoops_.....}> variable.

4
brentw
Re: changing header for different pages?
  • 2005/6/15 13:59

  • brentw

  • Just popping in

  • Posts: 18

  • Since: 2005/5/25


I figured out how to do this. XOOPS uses the following code in header.php to determine if the loaded page is the top page or not:

[size=xx-small] $toppage = false;
if (isset($xoopsModule)) {
// set page title
$xoopsTpl->assign('xoops_pagetitle', $xoopsModule->getVar('name'));
$xoopsTpl->assign('xoops_dirname', $xoopsModule->getVar('dirname'));
$moduleid = $xoopsModule->getVar('mid');
if (preg_match("/index\.php$/i", xoops_getenv('PHP_SELF')) && $xoopsConfig['startpage'] == $xoopsModule->getVar('dirname')) {
$toppage = true;
}
} else {
$xoopsTpl->assign('xoops_pagetitle', htmlspecialchars($xoopsConfig['slogan'], ENT_QUOTES));
$xoopsTpl->assign('xoops_dirname', "system");
$moduleid = 0;
if (!empty($xoopsOption['show_cblock'])) {
$toppage = true;
}
}
[/size]

I'll just use similar code to determine which header to render.

Login

Who's Online

243 user(s) are online (26 user(s) are browsing Support Forums)


Members: 0


Guests: 243


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Oct 31
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits