Re: [htmltmpl] RFC: Template Tag Attributes
Brought to you by:
samtregar
From: Timm M. <tm...@ag...> - 2004-06-02 17:47:00
|
At 01:10 PM 6/2/04 -0400, Sam Tregar wrote: >On Wed, 2 Jun 2004, Timm Murray wrote: > > > I have a project which involves changing our current pages using SSI > > #includes into using an HTML::Template-based solution instead. The > > question of how to search these templates came up, and I've suggested using > > htdig:// with a filter program that will convert the templates into text > > for indexing. > >I suggest you use a web-spider to index your site, which would of >course run HTML::Template to produce output. That way you index >everything the end-user sees, not just the static parts of the page. >I don't know for sure but I bet htdig:// comes with a web spider. If >not 'wget -r' is handy in a pinch! See other responses. > > Inevitably, there will be certain pages using TMPL_INCLUDE tags. I imagine > > that most of these will contain data that will not want to be searched for, > > such as footers, and therefore my filter program can simply ignore > > them. However, I don't feel safe in making the blanket assumption that > > /all/ included files don't need to be searchable. > >Now you've lost me. There's lots of stuff in an HTML page that >shouldn't be searched for. Stuff like headers and footers in includes >is just the tip of the ice-berg. Why obsess over this? I want to give content authors more control over what portions of a document are searched for. > > Is it possible to add a flexible attribute system to the current > > HTML::Template design? I'm thinking of something like this: > > > > <TMPL_INCLUDE NAME="file.txt" SEARCHABLE="no"> > >I'd write that: > > <TMPL_INCLUDE NAME="file.txt"><!-- SEARCHABLE="no" --> > >That way HTML::Template does its job, same as always, and your code >can key on the special comment. Yes, I think this is the way to go. > > I'm sure it can be done with a filter, but frankly, I think that's a > > cop-out solution, being that the current filter mechanism does not have a > > way to hook into HTML::Template's parser. > >Why would you need to hook into the parser to implement this? For the attribute syntax I originally suggested, it needs to be notified of the extra attributes (which I think would be useful for more than just this instance). More generally, filters should hook into the parser directly instead of merely being fed the content to be processed. |