Hmm, still seems to me your solution can be solved in the controller,
instead of bogging the template layer with something it shouldn't really
concern itself with.  The controller decides on the layout, and the
view, and depending on that information it request a different view that
works with that item.  If something does or doesn't exists you should
have set up the presentation logic to handle all these cases.

Bet regards,
Levi





Moritz Baumann wrote:
> Levi Stanley <l...@...> writes:
>
>   
>> Sounds like what you are describing is a Site / Page Controller?
>>     
>
> I tried to explain the script a bit further to make clear how the skeleton
> template is being used. It just defines the general Layout of the page. I 
> wanted
> to insert the actual content by making the skeleton template call macros whose
> names are stored in an array which is passed to the template (one per content
> area which the skeleton provides).
>
> This works fine as long as the inserted content is e.g. a tag cloud of a 
> blog. I
> can just call the macro blog.html/tag_cloud. But if it is text stored inside a
> database which I want to be treated as a part of the template (it might be a
> text page that links to a blog entry whose URI could change, therefore I want
> the link to be generated automatically), it won't.
>
> The solution Kornel proposed would perfectly work as long as only the »main
> content« of the requested page (which would then be the template I instruct
> PHPTAL to parse and which would call the skeleton template as a macro) can be
> such text. But that'd still be a serious restriction.
>
> Moritz
>
>
> _______________________________________________
> PHPTAL mailing list
> PHPTAL@lists.motion-twin.com
> http://lists.motion-twin.com/mailman/listinfo/phptal
>
>   

_______________________________________________
PHPTAL mailing list
PHPTAL@lists.motion-twin.com
http://lists.motion-twin.com/mailman/listinfo/phptal

Reply via email to