zope list as a slot
by
kedai
—
last modified
Mar. 03, 04 02:56 PM
Here's how to use KebasData to get the latest post to the zope list as plone slot.
The source is yahoo group
first, we need go to portal-skins / custom
we need three objects:
- a KebasData instance (id: zlist)
- a script Python (as render_method)
- a page template slot
- Instantiate a KebasData instance. let's call it zlist. enter:
url:http://groups.yahoo.com/group/zope/
pattern: <font face=.?><a href="(.?)">(.?)</a> - <b>(.?)</b></td>
start pattern:<!-- Recent Messages -->
end pattern:form name="searchform"
render_method:sc_zlist
- now, create a Script python with id sc_zlist. fill in the necessary:
parameters: a,b
for l,t,u in context.match:
print <a href="http://groups.yahoo.com/%s">%s</a> by %s % (l,t,u)
return printed
- Now, we add a slot to call. Create a Page Template with id zlist_slot.
<!-- The zlist box -->
<span metal:define-macro="zlistBox"
class="box"
summary="zopelist" cellpadding="0" cellspacing="0"
i18n:domain="plone"
>
<div class="box">
<h5 i18n:translate="links_title">Zope List</h5>
<div class="body">
<div class="content">
<x tal:replace="structure here/zlist" />
</div>
</div>
</div>
</span>
- When that's done, test the KebasData instance (zlist). Initialize, or view to check out if it works.
- When that's done, go to plone root, click properites, and enter the following to the slot you want.
here/zlist_slot/macros/zlistBox
- We're done. I still haven't make good on my promise to put up some kind of archive or library for such snippets.