Hello all, I sent this to the forem by mistake, and I got flack because of it, hopefully it reaches the right place this time. I have a question that may or may not be answerable. I have a site that is set up as so: There is a something.htm that calles other objects, like so: <dtml-var level1_header> <dtml-var level1_sidebar> <dtml-var l1_phoneit> <dtml-var l1_dialit> <dtml-var l1_findit> <dtml-var level1_footer> I was wondering if there was a way that I could extract the information from this ".htm" object so that I could determine which objects are being called from it, excluding the header, footer, and sidebar. Is this possable? Thanks
Eric Vautour wrote:
Hello all, I sent this to the forem by mistake, and I got flack because of it, hopefully it reaches the right place this time. I have a question that may or may not be answerable. I have a site that is set up as so:
There is a something.htm that calles other objects, like so:
<dtml-var level1_header> <dtml-var level1_sidebar> <dtml-var l1_phoneit> <dtml-var l1_dialit> <dtml-var l1_findit> <dtml-var level1_footer>
I was wondering if there was a way that I could extract the information from this ".htm" object so that I could determine which objects are being called from it, excluding the header, footer, and sidebar.
Is this possable?
Thanks
It is possible if you use the DTML parser from an external method. It returns a list of blocks representing the tags in a parsed form. You could in theory loop through this parsed data and extract the names of the called objects. Take a look at the parse method of the DT_String module in lib/python/DocumentTemplate. DTML Docs and methods subclass the String class, so you could call it externally on these objects. BTW: Please don't post HTML messages to the list. You will get less flak and more responses with plain text. -- | Casey Duncan | Kaivo, Inc. | cduncan@kaivo.com `------------------>
Eric Vautour writes:
.... <dtml-var level1_header> <dtml-var level1_sidebar> <dtml-var l1_phoneit> <dtml-var l1_dialit> <dtml-var l1_findit> <dtml-var level1_footer>
I was wondering if there was a way that I could extract the information from this ".htm" object so that I could determine which objects are being called from it, excluding the header, footer, and sidebar. You can, if you have sufficient privileges:
If you have a DTML object, you can use its method "document_src" to obtain its source (You must have the role 'View management screens'). You can then use "string.split" to split the source into lines and slice access to select the variables names, e.g. "line[10:-2]". More info: Python library reference and Python manual. Dieter
participants (3)
-
Casey Duncan -
Dieter Maurer -
Eric Vautour