How to get (and manipulate) rendered html of a dtml method prior to publishing?
Hi, How do I get a dtml-method to render its html prior to publishing the page? I have a dtml-method which normally is inserted into another page i.e. <dtml-var some_dtml> inside index_html. This inserts the dtml of some_dtml into index_html, then index_html is published, right? But I have a single occasion where I need to get the rendered html some_dtml would create, prior to index_html being published. I need to retrieve some of the html using _.string.split etc. How do I grab the html in such away that I can manipulate it?? I have tried variations of <dtml-var some_dtml html_quote> which gives me the html I need, but I cant workout how I can put this into a <dtml-let ...> or similar to manipulate. I have tried other ideas but they all return the dtml in some_dtml rather than its html, giving me errors. Your help on a simple solution (I am sure!!!) will be much appreciated. Thanks Richard
Richard Ettema wrote:
Hi,
How do I get a dtml-method to render its html prior to publishing the page?
I have a dtml-method which normally is inserted into another page i.e. <dtml-var some_dtml> inside index_html. This inserts the dtml of some_dtml into index_html, then index_html is published, right? But I have a single occasion where I need to get the rendered html some_dtml would create, prior to index_html being published. I need to retrieve some of the html using _.string.split etc. How do I grab the html in such away that I can manipulate it??
I have tried variations of <dtml-var some_dtml html_quote> which gives me the html I need, but I cant workout how I can put this into a <dtml-let ...> or similar to manipulate. I have tried other ideas but they all return the dtml in some_dtml rather than its html, giving me errors.
Your help on a simple solution (I am sure!!!) will be much appreciated.
Thanks
Richard
You need to call it separately and maniplulate the result like so: <dtml-let rendered="DTMLDoc(_.None, _)" lines="_.string.split(rendered)"> ... </dtml-let> the key here is he (_.None, _) which is how to call a DTML object from another object. It's ugly, but it works. This would be better implemented as a Python script though... -- | Casey Duncan | Kaivo, Inc. | cduncan@kaivo.com `------------------>
This would be better implemented as a Python script though...
I find myself saying this alot.
To expand on my point. Anytime I need to use "_['something']" or other similar manipulations to access data I say to myself, "This would be better implemented as a Python script."
Steve Drees wrote:
This would be better implemented as a Python script though...
I find myself saying this alot.
To expand on my point. Anytime I need to use "_['something']" or other similar manipulations to access data I say to myself, "This would be better implemented as a Python script."
<sarcasm>It's too bad you never use DTML anymore then...</sarcasm> 8^) -- | Casey Duncan | Kaivo, Inc. | cduncan@kaivo.com `------------------>
<sarcasm>It's too bad you never use DTML anymore then...</sarcasm>
Oooohhhh that hurt! Casey - 1 ; Steve - 0 <Ring Announcer> Tommy Innovation: The Best Way To Predict The Future ... Is To Create It. </Ring Announcer>
participants (4)
-
Casey Duncan -
Richard Ettema -
Steve Drees -
Tommy Johnson