in reply to Re: Building html site maps
in thread Building html site maps


Many thanks for reply.

I'll need to make a hard copy of that and study it to try and see what's happening there. Certainly looks a lot neater than what I have at the moment.

I think I need to have one more 'go' at H::T, but I must admit I still hanker after having it all in the script! Again, many thanks

Replies are listed 'Best First'.
Re^3: Building html site maps
by punkish (Priest) on Jan 31, 2005 at 21:28 UTC
    I think I need to have one more 'go' at H::T, but I must admit I still hanker after having it all in the script!

    It is your script, so do what you wish. However, it would be great if you share the reason for your "hankering." Maybe we will learn something.

    Otoh, trust me, no better yet, trust the wisdom of ages -- separating logic from display would be the best transition you will make in programming. Putting millions of print and printf statements in the script not only creates a rat's nest, it is a mess trying to fix errors, and a chore trying to change its looks after-the-fact.

    Other templating systems have received a lot of traction, and I know not much about them. What I like about H::T is its desire to be good at very, very few things -- kinda like the iPod. And I really appreciate Sam Tregar's (the author of H::T) almost bull-headed insistence (as it seems to me on reading his posts on the H::T list) on not introducing unnecessary logic in the H::T code. It makes for one of the most wonderful pieces of code to work with.

    Try it. You may never work without it again whether you are creating dynamic or static websites or even munging data in non-web apps.

      I've tried it. Below is the script. It is verbose with shed loads of temps. When I'm more comfortable with what's happening I'm sure I'll be able to improve it (and some error checking would be nice!)

      I've also included the business section of the template (sans static content). It doesn't look as bad as I thought it would although there seems to be more template than html.

      The hardest part was building the data structures for the nested loops.

      Thanks for your gentle cajoling it was what I needed!

      Again, many thanks John