Zope stuff

April 07, 2005

Doing dynamic reStructuredText in Zope

Suzanne and I have been playing with reStructuredText in Zope as a means of rapidly adding large chunks of copy to our new website. It is HWAYYY better than the old StructuredText.

The policy on the new site is that we are more carefully managing the URLs in page links and for the moment at least storing these as folder properties to be called in ZPT. This means for the navigation we only need to change URLs in one place.

We need to able to do the same in a simple way for links in rstx. This has its own way of handling URLs for links where they need only be defined once in the document to be re-used in lots of places.

We need a way to insert the values of properties into our rstx documents.

Fortunately in ZPT (which is where we are calling our rstx from) you have to define a rstx parser object and then pass text to it. This means that we could pass it the result of a DTML method and have the template still treat that text as rstx.

So instead of creating a reStructuredText document with the following:

.. _contact_us: /contact/contact_us

We create a DTML method with the following:

.. _contact_us: <dtml-with new_site><dtml-var contact_us_url></dtml-with>

So in our page template we now have the following to call the stx engine and the dtml:

<div style="text-align: justify;" id="content" tal:define="stx python:modules['Products'].PythonScripts.standard.restructured_text; content_text python:root.contact.index_html_dtml(root.contact);" tal:content="structure python:stx(content_text)"/>

Where this syntax: python:root.contact.index_html_dtml(root.contact) calls the DTML, passing its context as an argument.

Posted by pj at 11:12 AM

April 04, 2005

Paper detailing how to rig Zope / Plone up with Shibboleth authentication

MAMS - "Shibbolizing" Zope

Posted by pj at 08:56 PM