> A)
> Template inheritance is as compile time process where parent and child
> templates are merged in a single compiled file.
> For this reasion variable file names in {extends} can be used only if you
> use a compile_id which contains the variable part like
> $smarty->compile_id = $oTopic->getType(); (see
> http://www.smarty.net/docs/en/variable.compile.id.tpl)
> See also the note at
> http://www.smarty.net/docs/en/language.function.extends.tpl
> Another solution is not to use the {extends} tags but the extends resource
> when calling display() see
> http://www.smarty.net/docs/en/resources.extends.tpl. Here you can use
> variable file names without defining a compile_id.
> B)
> I could not reproduce this problem.
> I do get the expected result of:
> ..another code..
> ..some code..
> ...
> ..some code..
> ..another code..
> Am Montag, 13. August 2012 02:46:53 UTC+2 schrieb Sergey Y.:
>> i have 4 files:
>> 1. topic.prototpe.tpl -- consists topic structure with code/content in
>> {block}'s
>> 2. topic_link.tpl -- template of topic type: link
>> 3. topic_quesion.tpl -- template of topic type: question
>> 4. preview_topic.tpl -- universal preview template
>> problems:
>> A) [cache problem]
>> preview_topic.tpl starts with
>> {extends file="topic_{$oTopic->getType()}.tpl"}
>> when i changes topic type, display() sends to me result for previous
>> topic type, but with content for new $oTopic
>> B) [chain inherit problem]
>> topic.prototpe.tpl consists code:
>> {block name="topic_body_wrap"}
>> ...
>> {/bock}
>> topic_link.tpl extends topic.prototpe.tpl and consists code:
>> {block name="topic_body_wrap"}
>> ..some code..
>> {$smarty.block.parent}
>> ..some code..
>> {/bock}
>> preview_topic.tpl extends topic_{link|question}.tpl and consists code:
>> {block name="topic_body_wrap"}
>> ..another code..
>> {$smarty.block.parent}
>> ..another code..
>> {/bock}
>> i expects output from preview_topic.tpl:
>> ..another code..
>> ..some code..
>> ...
>> ..some code..
>> ..another code..
>> but got something like that:
>> ..another code..
>> ..another code..
>> ..some code..
>> ...
>> ..some code..
>> i tried to combine append/prepend attributes in {block}, but code
>> positions unpredictable mixing too