Re: [Zope] DTML to search a lines property in a DTML Document?
Are all of the documents in a specific folder or are they all over the place???
All in the same folder. Ron
complaw@hal-pc.org wrote:
Can you, using DTML, search a lines property of a DTML Document to look for
a
specific string? I have a set of DTML Documents with a custom lines property (called, e.g., "doctrines") and I want to search through the list in the context of a conditional statement in order to filter out the DTML Documents that don't have a specific doctrine in the doctrines property (or list those that do).
Has anyone ever done that or something similar?
TIA,
Ron
_______________________________________________ Zope maillist - Zope@zope.org http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce
That makes it much easier since you won't need to recurse through the entire site. Hang on, a while ago, I made a widget that searchs an entire site for a user entered property, I'll hack it and post it in a minute or two. Dan complaw@hal-pc.org wrote:
Are all of the documents in a specific folder or are they all over the place???
All in the same folder.
Ron
complaw@hal-pc.org wrote:
Can you, using DTML, search a lines property of a DTML Document to look for
a
specific string? I have a set of DTML Documents with a custom lines property (called, e.g., "doctrines") and I want to search through the list in the context of a conditional statement in order to filter out the DTML Documents that don't have a specific doctrine in the doctrines property (or list those that do).
Has anyone ever done that or something similar?
TIA,
Ron
_______________________________________________ Zope maillist - Zope@zope.org http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce
Here you go <dtml-in "objectItems(['DTML Document'])"> <dtml-with sequence-item> <dtml-in "propertyItems()"> <dtml-if "_['sequence-key'] == 'Prop'"> <dtml-comment> Put your test code here</dtml-comment> <dtml-var sequence-item><br> </dtml-if> </dtml-in> </dtml-with> </dtml-in> I made a folder and put three DTML Documents in it, they all had a property called Prop thus the line <dtml-if "_['sequence-key'] == 'Prop'"> (change 'Prop' to suit your needs. HTH Dan complaw@hal-pc.org wrote:
Are all of the documents in a specific folder or are they all over the place???
All in the same folder.
Ron
complaw@hal-pc.org wrote:
Can you, using DTML, search a lines property of a DTML Document to look for
a
specific string? I have a set of DTML Documents with a custom lines property (called, e.g., "doctrines") and I want to search through the list in the context of a conditional statement in order to filter out the DTML Documents that don't have a specific doctrine in the doctrines property (or list those that do).
Has anyone ever done that or something similar?
TIA,
Ron
_______________________________________________ Zope maillist - Zope@zope.org http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce
participants (2)
-
complaw@hal-pc.org -
Daniel G. Rusch