in reply to Evaluating subroutines from within data
I'm pretty sure there are other template systems as well. The whole point is that they support the idea of allowing "text data" (the template) to function as code when you want it to.
If I understand your description, you'd like to have a "definition list" stored in one file, and then have one line in the data for a given page that will simply incorporate the def.list at a chosen point. That's one of the nice things that a template system will do very easily. (Other things you might like include loops and conditionals, all tied up in a format that still ends up looking a lot like the actual document structure that defines your page layout.)
Maybe the amount of refactoring you'd have to do to switch whole-hog to a template system is more work that you want to do, which would be a shame, because it's not clear that carrying on in your current direction, without a template system, will be any less arduous.
I actually think there's a good chance that you can try a simpler template system just for this one (class of) page layout(s) that you're struggling with, and not break the rest of your app. Then you can gradually expand your use of templates as you continue to grow and update the app.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Evaluating subroutines from within data
by Lady_Aleena (Priest) on Jan 07, 2012 at 06:44 UTC | |
by Anonymous Monk on Jan 08, 2012 at 00:57 UTC | |
by Lady_Aleena (Priest) on Jan 08, 2012 at 02:45 UTC | |
by Anonymous Monk on Jan 08, 2012 at 04:23 UTC | |
by Lady_Aleena (Priest) on Jan 08, 2012 at 06:21 UTC | |
|