1
kaldorg
Display a different image depending on which module is active
  • 2004/2/5 17:49

  • kaldorg

  • Just popping in

  • Posts: 1

  • Since: 2004/2/5 1


Hi - just started looking at XOOPS recently and so far i've been very impressed by what i've seen. I've been trying to get my head around theme and module development and i think i understand the basics now.

I want to display a different image at a particular place in the page dependant on which module is currently active. Originally i thought i could do this just by playing with the template, but now as i'm beginning to get my head around smarty templates i'm thinking that's not enough. The currently active module name does not appear to be one of XOOPS default smarty variables (correct me if i'm wrong, but the list i saw definitely didn't include it).

The best idea i've come up with is to edit header.php so it exports another smarty variable with the module name. i'm thinking
xoopsTpl->assign('modname',$xoopsModule->getVar('dirname'));

should do that?
and then just use something like
<img src="/images/<{$modname}>/module_image.jpg">

at the appropriate place in my theme.

However, i really would prefer to avoid hacking any of the core XOOPS files if possible. Is there a smarter way to do this? Will my suggestion even work?

Thanks

2
SevenD
Re: Display a different image depending on which module is active
  • 2004/2/5 18:08

  • SevenD

  • Not too shy to talk

  • Posts: 143

  • Since: 2003/7/23


This is one possibility:

<img src="module_image.jpg">

Create module_image.jpg for each module and insert it in module folder.


3
kahumbu
Re: Display a different image depending on which module is active
  • 2004/2/5 18:56

  • kahumbu

  • Documentation Writer

  • Posts: 277

  • Since: 2003/8/23


This Forum Link might help:

Changing Site Logo by Topic

4
davidl2
Re: Display a different image depending on which module is active
  • 2004/11/13 19:56

  • davidl2

  • XOOPS is my life!

  • Posts: 4843

  • Since: 2003/5/26


Has anyone got any details of the above linked to post??

Thanks

Login

Who's Online

140 user(s) are online (120 user(s) are browsing Support Forums)


Members: 0


Guests: 140


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