1
mrjingles
Can I use different themes for different pages?
  • 2005/6/1 23:05

  • mrjingles

  • Just popping in

  • Posts: 22

  • Since: 2004/11/10


Hi,

I am wondering if it is possible to create pages that do not use the default theme set up for my site?

For example, let's say that 99% of my site fits into the template I have designed but when visitors click a particular link it opens a new window that does not include my logo and navigation sections (i.e. it shows just the content on the page and that's it).

Any help would be greatly appreciated

Cheers

2
pod
Re: Can I use different themes for different pages?
  • 2005/6/1 23:54

  • pod

  • Quite a regular

  • Posts: 301

  • Since: 2003/4/19



3
mrjingles
Re: Can I use different themes for different pages?
  • 2005/6/5 12:24

  • mrjingles

  • Just popping in

  • Posts: 22

  • Since: 2004/11/10


Thanks for the link. It has certainly helped me a little.

However, I may need a little further help. I can now successfully create different themes for different modules.

What I am trying to do is create a different theme for one page within a module. i.e. Theme1 is used for all of the site. When someone opens a link (i.e.http://mysite.com/modules/amodule/thispage.php) I want only this page to be displayed using theme2 and not any other pages for the module.

Here is part of the code for changing the theme for a particular module (taken from the link):
<{php}>
    
$mod $GLOBALS['xoopsModule'];
    
$dirname = (isset($mod) ? $mod->getVar('dirname') :'system');
if (
$dirname == 'amodule') {
   
$theme='theme2';
  } else {
   
$theme='theme1';
}


I am unsure how to change this code to enable it to run for a specific page within a module.

Any ideas or help would be appreciated. Thanks in advance.

4
ladon
Re: Can I use different themes for different pages?
  • 2005/6/5 12:54

  • ladon

  • Quite a regular

  • Posts: 284

  • Since: 2003/10/31


Don't know how to achieve that using that code, do have a less clean trick for you though:

Rename theme.html to theme_main.html and create theme.html with only this code:

<{if $xoops_pagetitle == modulename thispage }>
    <{include 
file="themedir/themefile_extra1.html"}>
<{elseif 
$xoops_pagetitle == modulename thatpage }>
    <{include 
file="themedir/themefile_extra2.html"}>
<{else}>
    <{include 
file="themedir/theme_main.html"}>
<{/if}>


Of course this is only to be used in the theme that you use to display with that particular module (with the code you use in your previous posts).

Might not be the best solution, but it works

5
Mithrandir
Re: Can I use different themes for different pages?

Or wait until XOOPS 2.2, where you will be able to set blocks visible on individual pages (specified by the module developer) and therefore can have a custom PHP-type block with just this code in it:
$GLOBALS['xoopsConfig']['theme_set'] = "desired_theme";

that is only visible on that page, you want it to be - provided the page is specified in the module's xoops_version.php

6
ladon
Re: Can I use different themes for different pages?
  • 2005/6/5 13:07

  • ladon

  • Quite a regular

  • Posts: 284

  • Since: 2003/10/31


Nice addition, be sure do document it in the FAQ when it's implemented (or when 2.2 is released). Because I think there are quite some ppl around wanting to use something like this!

7
mrjingles
Re: Can I use different themes for different pages?
  • 2005/6/5 18:15

  • mrjingles

  • Just popping in

  • Posts: 22

  • Since: 2004/11/10


Thanks for all the response!!

This has certinaly helped me and for the moment I'll use the solution by ladon but am looking forward to the next release of Xoops!

Thanks again!

Login

Who's Online

147 user(s) are online (96 user(s) are browsing Support Forums)


Members: 0


Guests: 147


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