xoops forums

M4d3L

Just popping in
Posted on: 2004/3/31 20:58
M4d3L
M4d3L (Show more)
Just popping in
Posts: 60
Since: 2002/11/18
#1

1 theme for each modules

I want to make 1 themes for each modules on my website.

I think it's possible to do this for each group
<{if $xoops_isadmin}>
  <{include 
file="x2t/themeadmin.html"}>
<{/if}>


But how can get the variable of the current module? and create a smarty code?

KubaZ

Just popping in
Posted on: 2004/3/31 22:54
KubaZ
KubaZ (Show more)
Just popping in
Posts: 37
Since: 2002/10/9
#2

Re: 1 theme for each modules

it's easy

if you don't want to make change in php code you can use smarty variable <{$xoops_pagetitle}> (why ? - look below) it contains : name of module or if page slogan (if module isn't active [like home page without default module])

--------
coding php

look at header.php at line 112:
Quote:

[112] if (isset($xoopsModule)) {
// set page title
$xoopsTpl->assign('xoops_pagetitle', $xoopsModule->getVar('name'));
(...)
[120] } else {
$xoopsTpl->assign('xoops_pagetitle', $xoopsConfig['slogan']);
(...)


if is set any module variable 'xoops_pagetitle' will be a name of actually module else as I said before (line 120) will be a slogan.

--
but if you don't want to have slogan you can simply add the code, e.g. before line 112:

Quote:

$xoopsTpl->assign('xoops_modulename', $xoopsModule->getVar('name'));

and in smarty template use var <{$xoops_modulename}>

I don't know if it is necessary to check if $xoopsModule is set...(maybe yes.. and sometimes you will got a blank page)

so you can add 2 lines of code instead one

Quote:

112] if (isset($xoopsModule)) {
// set page title
[114] $xoopsTpl->assign('xoops_modulename', $xoopsModule->getVar('name'));
$xoopsTpl->assign('xoops_pagetitle', $xoopsModule->getVar('name'));
(...)
[121] } else {
$xoopsTpl->assign('xoops_modulename', 'default');

$xoopsTpl->assign('xoops_pagetitle', $xoopsConfig['slogan']);
(...)


M4d3L

Just popping in
Posted on: 2004/4/11 1:11
M4d3L
M4d3L (Show more)
Just popping in
Posts: 60
Since: 2002/11/18
#3

Re: 1 theme for each modules

Tank a LOT!