dreel has asked for the wisdom of the Perl Monks concerning the following question:

Hi folks. I have a problem with dynamic template generating "path" showing where is user now. Example URL: /main/category/1/html Main-Categories-TechLib-Html or URL: /main/category/ Main-Categories or: URL: /main/blog/post/10/02/2007 Main-Blog-Posts-Title of post Something like this. I'm using catalyst frame work. There is one decision in my head: create tree in a hash of section info with parent_id.
[% sect_info = { main => {url => '/main', title => 'Main page of app', name => 'Main +', parent => ''} category => { url => '/main/category', title => 'List of catego +ries', name => 'Categories', parent => 'main' } } %]
and create function to parse this tree. Have any decisions?

Replies are listed 'Best First'.
Re: Build link list derend on URL (TT2)
by TOD (Friar) on Nov 09, 2007 at 11:24 UTC
    what if you take a look at the existing XML parsers? it seems to me as if you're running on the wrong track...
    --------------------------------
    masses are the opiate for religion.
      Finally I've found a simple derision for TT2/ It has a perfect thing WRAPPER with additional params. I've done the hash map in separated path.tt containing uri, name, title, parent and anything I need. How do I use it? It's simple:
      [%WRAPPER page.tt name = 'main '%]
      And function in path.tt select an element from hash and generates links for each item in path. It's perfectly working now.