Archive | December, 2006

Selecting content item as default view of a folder (including the /Members folder!)

I always wondered why the ‘Display’ tab containing the ‘select content item as default view’ was sometimes clickable and sometimes not. Well the answer is simple (it always is after you’ve found it): if you have an item in your folder called index_html, Plone will automatically recognise that as the default view item, and you have to rename it before you can access the ‘Display’ tab….

This also goes for the Members folder. By default, index_html will bring up a ‘search for members’ template, which I never found very useful, and always wanted to replace with a nice smart folder. First go into /Members in the zmi, select index_html (it’s in there somewhere amongst all the members), and rename it to something like index_html.old. Now, somewhere outside of Members, create the item you want to have as default view, and paste it into Members with title (guess) index_html.

This is a rather contrived way of going about things, I admit: Atmasamarpan tells me there is an index_home python script which calls index_html as the default view for the Members Large Plone Folder (which I have yet to find). Rename this script and you can access the display tab as normal. (Note: if you dont rename the script and there is no index_html item, you will get a site error when you try to acess the Members folder in Plone),.

Comments { 0 }

Inserting content of Plone document into Zope template

As explained in an recent article titled ‘Edit ZPT content through Plone ‘ on plone.org, we can insert the content of a document called my-document, say, by inserting the following into your template:

<tal:block tal:condition="exists:here/footer-content/my_document"
             tal:replace="structure here/footer-content/my_document/getText">
              Document content here</tal:block>

Perhaps one of these days Plone can use this method so that we can edit footers and colophons directly through Plone; ive submitted a ticket to Plone here…

Perhaps we could even extend it to things like bylines, although that’s a harder kettle of fish as we’re dealing with variables like creator and modification date. Any ideas, anyone?

Comments { 0 }