Archive for Plone

Some Plone tips

To add a tab in the green tab bar, go to portal_actions/object and add an action.

Some useful expressions:

  • string:${context/portal_url}/folder/document
  • python:portal.restrictedTraverse(‘@@plone_context_state’).current_page_url()==”testurl”

Note the python expression portal.restrictedTraverse allows python expressions/scripts to access the new browser views

Comments off

Plone Main Template Slots

Here is the list of slots that are defined in the master page template for Plone.

  • HEAD slots
    • base
    • head_slot
    • style_slot
    • javascript_head_slot
  • BODY slots
    • content
    • body
    • main (for most cases use this instead of content or body)
    • sub

To use one of these slots (for example, “style_slot”) use the metal:fill-slot macro

<style metal:fill-slot="style_slot" type="text/css">
 table.LesionLocation {border:1px solid blue;border-collapse:collapse;}
 table.LesionLocation td {border:1px solid black;padding: 5px;}
</style>

The page template must reference the master template:

<html xmlns="http://www.w3.org/1999/xhtml" 
xml:lang="en" lang="en" i18n:domain="plone"
metal:use-macro="here/main_template/macros/master">
...
</html>

Comments off