Smarty Forum Index Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon.

Objekt nur anzeigen wenn {if $smarty... / beinhaltet

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> Language: German
View previous topic :: View next topic  
Author Message
asff
Smarty Rookie


Joined: 03 Feb 2014
Posts: 6

PostPosted: Mon Mar 24, 2014 11:25 am    Post subject: Objekt nur anzeigen wenn {if $smarty... / beinhaltet Reply with quote

Hallo,
ich suche nach einer Möglichkeit,

Code:
{if $smarty.server.REQUEST_URI == '/menupunkt'}"box soll nur angezeigt werden wenn" {/if}


so zu erweitern, dass gesagt wird URI "beinhaltet" z.B. "Pflanze" damit jeweils z.B. Unterkategorie oder Produkte mit "Pflanze/Tulpe in der URL" etc. auch die Bedingung erfüll ist ?

Auch gefunden habe ich soetwas
Code:
{if $smarty.server.REQUEST_URI eq "index.php"}
<div id="banner_container">
    <div class="center">
 {else}
 <div id="banner_top_container">
 <div class="center clearfix">
 {/if}


Damit könnte ich auch viel "regeln" allerdings wäre noch nicht das Problem mit den Produkt urls erledigt.. bei den Produkten würde ich gerne auch je nach Kategorie die entsprechende Box bzw. Inhalt sehen..


Code:
$smarty.get.cat


wirkt auch leider nicht bei den Produkten.

Code:
{if $smarty.server.REQUEST_URI eq '/pflanzen/'}


auch schon versucht..

Jemand einen Vorschlag oder Idee ?
Back to top
View user's profile Send private message
U.Tews
Administrator


Joined: 22 Nov 2006
Posts: 5068
Location: Hamburg / Germany

PostPosted: Mon Mar 24, 2014 7:00 pm    Post subject: Reply with quote

Siehe http://de2.php.net/manual/en/function.stripos.php



Code:
{if stripos($smarty.server.REQUEST_URI,'/pflanzen/') !== false}
Back to top
View user's profile Send private message
asff
Smarty Rookie


Joined: 03 Feb 2014
Posts: 6

PostPosted: Tue Mar 25, 2014 3:16 pm    Post subject: Reply with quote

Vielen herzlichen Dank!
Genau so etwas habe ich gesucht.
Back to top
View user's profile Send private message
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> Language: German All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group
Protected by Anti-Spam ACP