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

Call, Caching and Sub-Templates (RC3)

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


Joined: 22 Apr 2009
Posts: 8

PostPosted: Tue Jul 20, 2010 8:09 pm    Post subject: Call, Caching and Sub-Templates (RC3) Reply with quote

I use one main Template file (named "index.tpl"), and several Sub-Templates that extend said template.

In the index.tpl, I use a call to create my site´s navigation menu:
{call name='create_menu' data=$pages_structure}

The definition of the create_menu function is also in the index.tpl:
Code:
{function name='create_menu' level=0}
   
   {foreach $data as $entry}
      {if $entry.type == 'dir'}
         {if count($entry.content) > 0}
            <div class="menu_entry menu_entry_level_{$level} menu_entry_dir">{$entry.name}</div>
            {call name='create_menu' data=$entry.content level=$level+1}
         {/if}
      {else}
         <div class="menu_entry menu_entry_level_{$level} menu_entry_page">
            <a href="{$entry.link}">{$entry.name|escape:'html'}</a>
         </div>
      {/if}
   {/foreach}
{/function}


Neither the call nor the function definition are in a block.

This works well when displaying either index.tpl or one of the extending templates.

But it refuses to work if I turn caching on.

There is no error message, the menu simply doesn´t appear. It still works in the index.tpl, but it does not in any of the extending templates.

Tested with RC1 and RC3, equal behaviour.
Back to top
View user's profile Send private message
U.Tews
Administrator


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

PostPosted: Thu Jul 22, 2010 7:18 pm    Post subject: Reply with quote

This was caused by a bug in the templateExists method.
The fix is in the SVN now.
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 -> Smarty 3 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