1
patagon
set theme.html to show only on homepage
  • 2004/11/11 20:51

  • patagon

  • Quite a regular

  • Posts: 235

  • Since: 2002/1/8 0


Hi,

I set in theme.html a table that I want to show in the homepage. it shows one table if you are registered and another if you are not, like this:

<{if !$xoops_isuser}>
show table one
<{else}>
show table two
<{/if}>

this works pretty well, but it shows the tables on all pages, and I only want it on the homepage. Is there a way of doing something similar, but also testing if it is the homepage? something like <{if !$xoops_isuser AND THIS IS THE HOMEPAGE}>

Thanks

2
skalpa
Re: set theme.html to show only on homepage
  • 2004/11/11 22:41

  • skalpa

  • Quite a regular

  • Posts: 300

  • Since: 2003/4/16


<{if !$xoops_isuser && $smarty.server.PHP_SELF=='/index.php'}>



skalpa.>

3
patagon
Re: set theme.html to show only on homepage
  • 2004/11/12 0:42

  • patagon

  • Quite a regular

  • Posts: 235

  • Since: 2002/1/8 0


Thanks skalpa, but that didnt work on my tests.

I tried setting it like this too (on theme.html), to make sure I didnt make a mistake anywhere else:

<{if $smarty.server.PHP_SELF=='/index.php'}>
show this text on the home only
<{/if}>

and it doesnt work (it doesnt show anything on any page)

Thanks

4
skalpa
Re: set theme.html to show only on homepage
  • 2004/11/13 1:28

  • skalpa

  • Quite a regular

  • Posts: 300

  • Since: 2003/4/16


Try to add this instead:
<{$smarty.server.PHP_SELF}>

go to your homepage to see its value, then replace my /index.php with what you got.
If your server doesn't create this var (it might happen, although I think this one shoudl be OK), try another one instead of PHP_SELF ( there may be SCRIPT_NAME, or REQUEST_URI ...)

skalpa.>

5
patagon
Re: set theme.html to show only on homepage
  • 2004/11/17 5:31

  • patagon

  • Quite a regular

  • Posts: 235

  • Since: 2002/1/8 0


Thanks skalpa! that worked perfectly

Login

Who's Online

316 user(s) are online (277 user(s) are browsing Support Forums)


Members: 0


Guests: 316


more...

Donat-O-Meter

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

Latest GitHub Commits