home contents changes options help subscribe edit (external edit)

DTML examples, tricks and hacks. See also http://zopelabs.com , http://zwiki.org/ZwikiCookbook , ...

Find vhost folders named like domains, except those with a null listed property, and sort by right-most domain parts (as at http://joyful.com):

 <dtml-let>
 sites="[o for o in aq_parent.objectValues(spec=('Folder','BTreeFolder2','Plone Site')) if '.' in o.id]"
 listed="[s for s in sites if getattr(s,'listed',0)]"
 dummy="listed.sort(lambda a,b:cmp(a.id.split('.')[::-1], b.id.split('.')[::-1]))">
 ...
 </dtml-let>



subject:
  ( 23 subscribers )