1
maxxy
help me with if else statements
  • 2007/7/25 6:11

  • maxxy

  • Quite a regular

  • Posts: 286

  • Since: 2007/6/11


i would like to use a different css for my smartsection page (only for the index page)

example

http://www.mysite.com/modules/smartsection/
http://www.mysite.com/modules/smartsection/index.php

will use mystyle.css


while for other page in ssection

will use the default style.css


How do i do this?

do i need to put the if else code in theme or in the modules template
help

2
pod
Re: help me with if else statements
  • 2007/7/25 7:23

  • pod

  • Quite a regular

  • Posts: 301

  • Since: 2003/4/19


This example presumes you are using XOOPS 2.0.14x or better, and gives you the option to employ 3 stylesheets - one for your smartsection index page, one for all other smartsection pages and another for any page outside of smartsection. You can change that to suit your needs by changing the style_yourstylesheet.css reference.

Open your theme.html and look for this line in the head of your document:
<link rel="stylesheet" type="text/css" media="all" href="<{xoImgUrl /style.css}>" />

Replace with:
<{if $xoops_dirname == "smartsection"}>          
          <{if 
$xoops_requesturi == "/your_xoops_root/modules/smartsection/index.php" or $xoops_requesturi == "/your_xoops_root/modules/smartsection/"}>
          <
link rel="stylesheet" type="text/css" media="screen" href="<{xoImgUrl /style_smartsection_main.css}>" />
          <{else}>
          <
link rel="stylesheet" type="text/css" media="screen" href="<{xoImgUrl /style_smartsection_other.css}>" />          
          <{/if}>
<{else}>
   <
link rel="stylesheet" type="text/css" media="screen" href="<{xoImgUrl /style.css}>" />   
<{/if}>


Hope this helps!
whttp://www.myxoops.com - MyXoops Is Your XOOPS!

3
maxxy
Re: help me with if else statements
  • 2007/7/25 10:28

  • maxxy

  • Quite a regular

  • Posts: 286

  • Since: 2007/6/11


wow thanks pod...

it works great

Login

Who's Online

363 user(s) are online (206 user(s) are browsing Support Forums)


Members: 0


Guests: 363


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