Hi,

From the documentation I can see there is quite a few introspection abilities 
via the template and component variables.  However I'm trying to do something a 
little more complex and can't figure out if there is a straightforward way to 
do this within TT or if I'm going to need to post process my output with XSLT 
or similar.  Here's what I'm trying to do:

In my CMS I have defined a number of wrapper templates to allow my users to 
simplify and standardize our eventual output.  One example of this is that I 
have a 'row' wrapper that defines some div tags and css to enclose some 
content.  Inside each row the user can define one or more 'cell' wrappers to 
add in html and css tags to properly align out content.  For (simplified) 
example:

[% WRAPPER row %]
    [% WRAPPER cell
         type = 'left' %]Some content[% END %]
    [% WRAPPER cell

         type = 'left' %]Some content[% END %]

    [% WRAPPER cell

         type = 'right' %]Some content[% END %]
[% END %]

Eventually we end up generating pages with complex layout like the following: 
http://216.154.222.179:10000/previewer/communities

One of the things I am trying to do is make my processing smarter and allowing 
my templates to be better at guessing what values should be.  This would allow 
my users to reduce the amount of stuff they put into the template, which should 
reduce errors and make our templates cleaner and more consistent.  For example 
if the above code the 'cell' template wrapper takes a value called 'type'.  I 
need this information to pass to the part of the code that builds the CSS for 
each cell.  Basically I find that I need the last cell to have special CSS in 
order to work properly.  I'd like somehow to detect if the currently processing 
template is the first or last in a given 'parent' but I can't figure this out.

I can see some ways to do this but they all involve creating more complex 
markup then I already have.

I realize this sounds like a trivial example, but I have more complex use cases 
of the above.  In general I have several cases where knowing if the currently 
processing template is the first or the last template for a given caller.  If 
hearing about that would help understand my question I will be happy to provide.

Thanks for any thoughts or suggestions.

--John







 
____________________________________________________________________________________
Need Mail bonding?
Go to the Yahoo! Mail Q&A for great tips from Yahoo! Answers users.
http://answers.yahoo.com/dir/?link=list&sid=396546091

_______________________________________________
templates mailing list
[email protected]
http://lists.template-toolkit.org/mailman/listinfo/templates

Reply via email to