1
M4d3L
1 theme for each modules
  • 2004/3/31 20:58

  • M4d3L

  • Just popping in

  • Posts: 60

  • Since: 2002/11/18


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?

2
KubaZ
Re: 1 theme for each modules
  • 2004/3/31 22:54

  • KubaZ

  • Just popping in

  • Posts: 37

  • Since: 2002/10/9


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']);
(...)



3
M4d3L
Re: 1 theme for each modules
  • 2004/4/11 1:11

  • M4d3L

  • Just popping in

  • Posts: 60

  • Since: 2002/11/18


Tank a LOT!

Login

Who's Online

159 user(s) are online (105 user(s) are browsing Support Forums)


Members: 0


Guests: 159


more...

Donat-O-Meter

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

Latest GitHub Commits