|
Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon. |
|
View previous topic :: View next topic |
Author |
Message |
fLowww Smarty Rookie
Joined: 30 Sep 2003 Posts: 7
|
Posted: Fri Oct 10, 2003 9:34 pm Post subject: Problem with building up a site ! |
|
|
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 |
|
boots Administrator
Joined: 16 Apr 2003 Posts: 5611 Location: Toronto, Canada
|
Posted: Fri Oct 10, 2003 10:53 pm Post subject: |
|
|
Try this: pass the values you need into the included template.
{include file=navi.html navi=$navi} |
|
Back to top |
|
messju Administrator
Joined: 16 Apr 2003 Posts: 3336 Location: Oldenburg, Germany
|
Posted: Sat Oct 11, 2003 5:26 am Post subject: Re: Problem with building up a site ! |
|
|
(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 |
|
Back to top |
|
|
|
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
|