[Templates] Integer division/multidimensional arrays and some other thoughts

Andrew Williams amw1@yahoo.com
Wed, 2 Aug 2000 15:20:05 -0700 (PDT)


first:

is there any way to do integer division?

i.e.  
int(5/2) = 2 


second:
How do I deal with multi dimensional arrays?  I can 
get hashes of hashes working fine but I can't figure
out how to deal with multi dimensional arrays.


Other stuff:

Is there a method to take a list of arbitrary lenght and
have it display in an arbitrary number of columns?

i.e.  I have a list of 13 names.  I want to have 3 rows
of 4 columns each and 1 row of 1 column.  (this kinda
relates to the first two questions tried to do it with 
pre-assigning the rows to a 2d array but couldn't get it
working, and tried some stuff with sizeing the array, doing
a div then doing a mod but no integer division sorta made
it not work)



It would also be usefull (at least for the stuff I'm
working on) to have hierarchical template structures. i.e. 

directory structure
/templates
  header.tpl
  footer.tpl
  logo.tpl
  /pageset1
    page1.tpl  
  /sub-site
    header.tpl
    footer.tpl
    /pageset2
      page2.tpl


page1 and page2 both have
[% INCLUDE header.tpl %] 
[% INCLUDE footer.tpl %]

page1 would use the ones defined in template
while page2 would use the ones defined in the sub-site
directory.


Very cool set of tools btw.

- andrew

__________________________________________________
Do You Yahoo!?
Kick off your party with Yahoo! Invites.
http://invites.yahoo.com/