xoops forums

heyula

Theme Designer
Posted on: 3/1 11:03
heyula
heyula (Show more)
Theme Designer
Posts: 429
Since: 2008/4/24
#1

Smarty Help

Hello!

I use the following code when I want to show a code in the home

<{if $smarty.server.PHP_SELF=='/index.php'}>
        <{
includeq file="$theme_name/home.html"}>
    <{/if}>


When I want to show the module page

<{if $xoops_dirname == "TDMDownloads"}>
        <{
includeq file="$theme_name/deneme.html"}>
    <{/if}>


I want

<{if $xoops_dirname == "TDMDownloads/singlefile.php"}>
<{includeq file="$theme_name/icerik.html"}>
<{/if}>

and

<{if $xoops_dirname == "TDMDownloads/viewcat.php"}>
<{includeq file="$theme_name/icerik.html"}>
<{/if}>
Is this possible ?

Bleekk

Theme Designer
Posted on: 3/1 12:08
Bleekk
Bleekk (Show more)
Theme Designer
Posts: 907
Since: 2002/12/14
#2

Re: Smarty Help

maybe you can use
<{if $smarty.server.REQUEST_URI|strstr:'TDMDownloads/viewcat.php'}>

heyula

Theme Designer
Posted on: 3/1 12:31
heyula
heyula (Show more)
Theme Designer
Posts: 429
Since: 2008/4/24
#3

Re: Smarty Help

@Bleekk

I really appreciate it very much. I can make independent themes with this code.

Mamba

Moderator
Posted on: 3/1 12:58
Mamba
Mamba (Show more)
Moderator
Posts: 10425
Since: 2004/4/23
#4

Re: Smarty Help

You can use Smarty for it:

<{if $homepage}>


It's defined in \modules\system\preloads\core.php

EDIT: sorry, I misunderstood what you were looking for. This code above is only to check if you're on the Home page or not.
Support XOOPS => DONATE
Use 2.5.9 | Docs | Modules | Bugs

Mage

Core Developer
Posted on: 3/1 15:15
Mage
Mage (Show more)
Core Developer
Posts: 167
Since: 2009/8/2 1
#5

Re: Smarty Help

Possible since xoops 2.5.9:

https://github.com/XOOPS/XoopsCore25/c ... 95381737c36d8defe6c04a6de

use:

https://github.com/XOOPS/XoopsCore25/c ... 1333ad2a435e04c88857cb4d7