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

Problem with building up a site !

 
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
fLowww
Smarty Rookie


Joined: 30 Sep 2003
Posts: 7

PostPosted: Fri Oct 10, 2003 9:34 pm    Post subject: Problem with building up a site ! Reply with quote

Hi guys ,

I have a `head.html` and a `footer.html` , which I use on each part of
the site.

head.tpl
------------
<html>
<body>
<table>
<tr>
<td>{include file=navi.html}</td>
<td>
------------

footer.tpl
-----------
</td>
</tr>
</table>
</body>
</html>
---------

and this 2 files are included in each part of the site for instance news.html

news.html
------------
{include file=header.html}
{section......}
....
{/section}
{include file=footer.html}
-------------------------


now I display the template:
$smarty->display('news.html');

until now there are no problems except the variables in navi.html aren't interpreted at all. I assign the array $navi in the index.php but it just doesn't work. the navi is very dynamic and each user has a different one I heard something of using {insert} but I can't figure out how to manage this does someone have any hints for me ?

the navi.html looks like this :

<table>
{section name=i loop=$navi}
<tr>
{if $navi[i].sort == 1}
<td bgcolor="#CDCDCD">
{$navi[i].label}
</td>
{else}
<td bgcolor="#DCDCDC">
<a href="{$smarty.server.php_self}?$navi[i].href">{$navi[i].label}</a>
</td>
{/if}
</tr>
{/section}
</table>

Any hints or comments are greatly appreciated
greetz
fLo

PS:

If someone likes to share knowledge with me just add me :
ICQ : 131810590
Msn-Messenger : grasshalm@hotmail.com

ever thought about opening a channel on IRC ?
Back to top
View user's profile Send private message
boots
Administrator


Joined: 16 Apr 2003
Posts: 5611
Location: Toronto, Canada

PostPosted: Fri Oct 10, 2003 10:53 pm    Post subject: Reply with quote

Try this: pass the values you need into the included template.

{include file=navi.html navi=$navi}
Back to top
View user's profile Send private message
messju
Administrator


Joined: 16 Apr 2003
Posts: 3336
Location: Oldenburg, Germany

PostPosted: Sat Oct 11, 2003 5:26 am    Post subject: Re: Problem with building up a site ! Reply with quote

(offtopic)

fLowww wrote:
ever thought about opening a channel on IRC ?


i openend #smarty on freenode a few weeks ago. it's very low-traffic because it hasn't been announced anywhere, yet. if anybody has time to waste feel free to check it out Smile
Back to top
View user's profile Send private message Send e-mail Visit poster's website
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