1
Norne
Different themes for different categories?
  • 2006/9/6 13:21

  • Norne

  • Just popping in

  • Posts: 12

  • Since: 2006/8/8 1


I see that there is a theme changer for users, so I guess that the function is embedded somewhere...

How can I submit 1 theme for one category and another for the next, but not as a choice for the user? Is there an option in the menu somewhere?

2
snow77
Re: Different themes for different categories?
  • 2006/9/6 14:28

  • snow77

  • Just can't stay away

  • Posts: 864

  • Since: 2003/7/23


You can find several options to change modules at this thread:
How to use a different theme for one of the modules ?

One is a code you can put in the theme files the other a theme changer module but different than the theme changing block that comes by default with xoops.
www.polymorphee.com
www.xoopsdesign.com

3
Norne
Re: Different themes for different categories?
  • 2006/9/8 22:20

  • Norne

  • Just popping in

  • Posts: 12

  • Since: 2006/8/8 1


It seems that I can't make this work...

I looked for the module, but my Japanese is terrible and the links are obsolete, I think. But a module would be great if I could find one, - it makes upgrade easier and it's a pretty clean way to keep track of changes. But I had to give up on that one. (Why are there so many broken links in XOOPS repository and support forums? Have you been hacked or something?)

Well, I realized that I don't really need to access a whole new theme. All I need is another css-file, or maybe I can do with just a different background. It seemed like such a simple task... But none of the suggestions I have found in here cover my need.

All I want to do is to use the News module and change css on different categories... Not a change on modules and not on every single page, but on the whole category (there will be authors without access to the scripts writing to different categories). But how can I embed the code and WHERE can I put it? I have tried lots of different ways and places, but nothing works.

So maybe News isn't the right tool to use here? I don't know, but I would certainly be willing to try another solution if it had the capability to change the appearance depending on content. I like Xoops, I like Smarty and I love the myAlbum module, but the possibilities seem very limited right now...

4
snow77
Re: Different themes for different categories?
  • 2006/9/8 22:42

  • snow77

  • Just can't stay away

  • Posts: 864

  • Since: 2003/7/23


yes you are right the links from that site are down. But the one from Module Repository HERE seems to be working to dowload Theme Changer 2.0.

But it won't work for news topics/categories. It's not impossible I think, but then you would need a special code that calls the news topic and renders a specific stylesheet for each. You would need a little custom PHP help here.
www.polymorphee.com
www.xoopsdesign.com

5
Norne
Re: Different themes for different categories?
  • 2006/9/8 23:18

  • Norne

  • Just popping in

  • Posts: 12

  • Since: 2006/8/8 1


Thanks! I'll try the module to see what it can do.

This makes me feel stupid! I know that I have all the information needed and still I can't put it together right. The "storytopic=4" should be a pretty good indicator to work with, for one... Well, I'm new to Xoops, Smarty and all the rest and I'm not a programmer. I know that I have to give it time and effort, but it looks simple and I should be able to make it work.

The PHP programming is a bit steep for me and I get confused by all the twists and turns in this brilliant software. I like it and I hate it and I find it very hard to access the right kind of information.

Any ideas on the custom PHP help that you mentioned??? I have all the information right at hand and it's just a question of putting the right code in the right place (like always). I just have to figure out HOW and WHERE.

Any suggetions are appreciated, because I can't accept the idea of this being impossible


6
rowdie
Re: Different themes for different categories?
  • 2006/9/9 7:11

  • rowdie

  • Just can't stay away

  • Posts: 846

  • Since: 2004/7/21


You can do this just by changing the news template.

1. Copy the template to your theme folder, so you have a path like:

xoopsroot/themes/mytheme/modules/news/news_index.html

2. In that folder create different css files for each category, using the category number in the name

i.e. style1.css, style4.css, etc... include also a style0.css and style.css for when no topics are selected

3. Then add this to the top of the news_index.html template:

<{assign var="catid" value=$smarty.request.storytopic}>
<{$xoTheme->addStylesheet("modules/news/style$catid.css")}>

Rowd :)

7
Norne
Re: Different themes for different categories?
  • 2006/9/9 12:04

  • Norne

  • Just popping in

  • Posts: 12

  • Since: 2006/8/8 1


Yepp, it works! Perfect!!!

I knew it could be done, but I was thinking the other way around and I came out in the wrong place. But this is very nice!

Thanks!

8
davidl2
Re: Different themes for different categories?
  • 2006/9/9 12:09

  • davidl2

  • XOOPS is my life!

  • Posts: 4843

  • Since: 2003/5/26


Excellent - another good usage of 2.0.14 onwards template enhancements... I want to try this later too

9
snow77
Re: Different themes for different categories?
  • 2006/9/10 17:21

  • snow77

  • Just can't stay away

  • Posts: 864

  • Since: 2003/7/23


thank you Rowdie for giving us the missing piece, help like this is very much appreciated and needed for when really trying to make the most out of a design for xoops
www.polymorphee.com
www.xoopsdesign.com

Login

Who's Online

136 user(s) are online (87 user(s) are browsing Support Forums)


Members: 0


Guests: 136


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