IMO the better approach is to define a smarty for one unique xoops_startpage_redirected php variable in class/theme.php
in class/theme.php
$this->template->assign(array(
'xoops_theme' => $GLOBALS['xoopsConfig']['theme_set'] ,
'xoops_imageurl' => XOOPS_THEME_URL . '/' . $GLOBALS['xoopsConfig']['theme_set'] . '/',
'xoops_themecss' => xoops_getcss($GLOBALS['xoopsConfig']['theme_set']),
'xoops_requesturi' => htmlspecialchars($_SERVER['REQUEST_URI'], ENT_QUOTES),
'xoops_sitename' => htmlspecialchars($GLOBALS['xoopsConfig']['sitename'], ENT_QUOTES),
'xoops_slogan' => htmlspecialchars($GLOBALS['xoopsConfig']['slogan'], ENT_QUOTES),
'xoops_dirname' => isset($GLOBALS['xoopsModule'])&& is_object($GLOBALS['xoopsModule']) ? $GLOBALS['xoopsModule']->getVar('dirname') : 'system',
'xoops_banner' => ($GLOBALS['xoopsConfig']['banners'] && $this->renderBanner) ? xoops_getbanner() : ' ',
// START irmtfan add startpage_redirected
'xoops_startpage_redirected' => defined("XOOPS_STARTPAGE_REDIRECTED"),
// END irmtfan add startpage_redirected
'xoops_pagetitle' => isset($GLOBALS['xoopsModule']) && is_object($GLOBALS['xoopsModule']) ? $GLOBALS['xoopsModule']->getVar('name') : htmlspecialchars($GLOBALS['xoopsConfig']['slogan'], ENT_QUOTES)));
then in your theme.html or any template you can use this syntax:
<{if $xoops_startpage_redirected || (!$xoops_startpage_redirected && $xoops_dirname == 'system') }>
The above smarty syntax maybe consider as a harder way in the first look but it is more comprehensive.
It said This is homepage IF
- a module other than system is set for startpage and the user is in index.php
OR
- no module is set for startpage and the user is in index.php
The above is good way for forward compatibility. (can work in the future xoops versions)
edit:
Quote:
<{if $xoops_dirname == 'system'}> would display the div on the search page as well.
If you want the specific page like index.php be the homepage again please use smarty like this:
<{if $xoops_startpage_redirected || ( !$xoops_startpage_redirected && $xoops_dirname == 'system' && ($xoops_requesturi == '/index.php' || $xoops_requesturi == '/') )}>
it means it is index.php or in the website domain.
Edit2:
I found it is easier to use $SCRIPT_NAME rather than $xoops_requesturi
so the above would be changed to:
<{if $xoops_startpage_redirected || ( !$xoops_startpage_redirected && $SCRIPT_NAME == '/index.php' )}>
With XOOPS you have too many options!!!
Edit3:
pay attention that $SCRIPT_NAME is case sensitive and should be write by uppercase alphabets.