Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Template inheritance problems [3.1.11]
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  3 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Sergey Y.  
View profile  
 More options Aug 12 2012, 8:46 pm
From: "Sergey Y." <exp....@gmail.com>
Date: Sun, 12 Aug 2012 17:46:53 -0700 (PDT)
Local: Sun, Aug 12 2012 8:46 pm
Subject: Template inheritance problems [3.1.11]

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


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
uwe.tews  
View profile  
 More options Aug 15 2012, 8:41 am
From: "uwe.tews" <uwe.t...@googlemail.com>
Date: Wed, 15 Aug 2012 05:41:53 -0700 (PDT)
Local: Wed, Aug 15 2012 8:41 am
Subject: Re: Template inheritance problems [3.1.11]

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.:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Sergey Y.  
View profile   Translate to Translated (View Original)
 More options Aug 21 2012, 4:30 pm
From: "Sergey Y." <exp....@gmail.com>
Date: Tue, 21 Aug 2012 13:30:27 -0700 (PDT)
Local: Tues, Aug 21 2012 4:30 pm
Subject: Re: Template inheritance problems [3.1.11]

A)
thanx, second solution is more suitable in my case, i will try it.

B)
i've tried it on different servers (win32 and freebsd) with different
versions of PHP and result was the same. may be it was side effect of
problem "A".

среда, 15 августа 2012 г., 16:41:53 UTC+4 пользователь uwe.tews написал:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »