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

If Else Condtion if template exist.

 
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 -> General
View previous topic :: View next topic  
Author Message
hiteshb
Smarty Rookie


Joined: 10 Jul 2010
Posts: 11

PostPosted: Sun Jul 11, 2010 3:41 pm    Post subject: If Else Condtion if template exist. Reply with quote

I made file while searching this forum - http://www.smarty.net/forums/viewtopic.php?t=11809

I am tring this function
Code:

{if "series.tpl"||"viewseries.tpl"|template_exists} active{/if}
but it seems it will not work for some reason.

Can anyone figure out whats the reason. or give me correct code.

I have created plugin file with below code.
Code:

<?php

function smarty_modifier_template_exists($string)
{
    global $smarty;
    return $smarty->template_exists($string);
}

?>
Back to top
View user's profile Send private message
hiteshb
Smarty Rookie


Joined: 10 Jul 2010
Posts: 11

PostPosted: Sun Jul 11, 2010 3:53 pm    Post subject: Reply with quote

I thought to put all source so that one can give me exact code.

Code:
<li class="menu"><a href="/index.php" class="yuimenubaritemlabel">Home</a></li>
<li class="menu"><a href="/news/" class="yuimenubaritemlabel">News</a></li>
<li class="menu"><a href="/series.php" class="yuimenubaritemlabel">Series</a></li>
<li class="menu"><a href="/teams.php" class="yuimenubaritemlabel">Team</a></li>
<li class="menu"><a href="/venues.php" class="yuimenubaritemlabel">Venues</a></li>
<li class="menu"><a href="/month.php" class="yuimenubaritemlabel">Monthly</a></li>
<li class="menu"><a href="/format.php" class="yuimenubaritemlabel active">Match Format</a></li>
<li class="menu"><a href="/results.php" class="yuimenubaritemlabel">Results</a></li>
<li class="menu"><a href="/contact.php" class="yuimenubaritemlabel">Contacts</a></li></ul>



I want below file to integrated in all tpl files. On the basis of file it should active tag. like below

Code:
<li class="menu"><a href="/index.php" class="yuimenubaritemlabel active">Home</a>



Thanks a lot for all help.
Back to top
View user's profile Send private message
hiteshb
Smarty Rookie


Joined: 10 Jul 2010
Posts: 11

PostPosted: Mon Jul 26, 2010 6:18 pm    Post subject: Reply with quote

so no reply yet ?
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 -> General 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