Harry Fuecks wrote:
>>From a glance, the code looks good, structure-wise. Should be do-able as a tag.
>
> On Sun, 20 Feb 2005 21:26:34 -0500, Ramin <i8ramin@...> wrote:
>
>>This was an email from last month, but I found a php implementation of
>>SiteMesh and thought it would be a very good idea to have it as part
>>of WACT .. what does everyone think?
>>
>>http://trypticon.org/software/phpmesh/
>>
>>If you dont know what SiteMesh is, follow this link:
>>
>>http://www.opensymphony.com/sitemesh/
>>
I'm trying to implement something like this, but I have some qustions on
how I might do this sort of thing at run time with WACT. Pointers to
articles or code examples that accomplish what I'm trying to do will be
appreciated.
First, I'd like to use WACT's HTML/XML parser to take a 'straight' html
file generated by Dreamweaver or other editor and be able to pull it
apart into sections of interest. For starters, I'd like to pull <head> &
<body> apart and place them into my WACT template, though it might be
nice to grab <div id='foo'>..</div> too.
The question is: Where do I start? How would I use the existing
HTMLParser to grab the bits I'm interested in and assign them to a
variables? I'm kind of envisioning a Parser class that returns a
DataSpace of the interesting bits:
<?php
$parser =& new SectionParser();
$parser->parse ('foo.html');
$ds =& $parser->getDataSpace();
$template =& new Template('layout.html');
$template->set('PageTitle', $ds->get('title'));
$template->set('PageBody', $ds->get('body'));
?>
The other side of that coin is once I have some raw HTML in a variable,
can I assign it to a <core:placeholder> in my template? The only way of
inserting raw html strings that seems to work is assigning it to the
Template dataspace, then having {$content|raw} in my template.
Thanks for the help.
--
Sincerely,
Kirk Ismay
|