1
hrac
How to pass variable to theme.html
  • 2004/8/2 22:45

  • hrac

  • Quite a regular

  • Posts: 305

  • Since: 2002/7/15


I want to pass a variable to theme.html, how can I do this:

For example current URL is:

http://www.mysite.com/xoopsroot/modules/news/index.php?x=1

then I want to pass a variable with following value:
$variable = /modules/news/index.php?x=1

How can I do this. My aim is to put some links in theme.html like that:

http://www.mysite.com/xoopsroot2<{$variable}>
http://www.mysite.com/xoopsroot3<{$variable}>

Thanks
Best regards

2
mschmid
Re: How to pass variable to theme.html
  • 2004/8/2 23:56

  • mschmid

  • Just popping in

  • Posts: 28

  • Since: 2002/9/19


hrac,

in the index.php you have to assign the $variable to the smarty template:

$variable = "/modules/news/index.php?x=1";
$xoopsTpl->assign('variable', $variable);

in the theme.html you can then go as you describet:
http://www.mysite.com/xoopsroot2<{$variable}>

Don't forget to update the module as the theme is only updated you do an install or update of the module.

hope it helps
Markus

3
hrac
Re: How to pass variable to theme.html
  • 2004/8/3 6:21

  • hrac

  • Quite a regular

  • Posts: 305

  • Since: 2002/7/15


Quote:
$variable = "/modules/news/index.php?x=1";


Markus,
Thanks for reply and help but $variable will not have a constant value like /modules/news/index.php?x=1. It is only an example. I want to pass last part of the current URL (after XOOPS ROOT or XOOPS PATH). How can I do this?
Thanks

4
skalpa
Re: How to pass variable to theme.html
  • 2004/8/3 6:34

  • skalpa

  • Quite a regular

  • Posts: 300

  • Since: 2003/4/16



5
hrac
Re: How to pass variable to theme.html
  • 2004/8/3 6:46

  • hrac

  • Quite a regular

  • Posts: 305

  • Since: 2002/7/15


Ok. I got how to do it for a module. But I want to do it globally for the complete site. So every page should have this. But I don't want to do it for every module. Which template should I modify?

Login

Who's Online

122 user(s) are online (107 user(s) are browsing Support Forums)


Members: 0


Guests: 122


more...

Donat-O-Meter

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

Latest GitHub Commits