New portlets
The following new portlets have been created in vsCore
- portlet_smart_list_(1-6): displays results of smart folder searches
- portlet_static_(1-3): displays static documents
- portlet_vsrandomdocument: displays a random document
- portlet_vsrandomimage: displays a random image
portlet_smart_list
At installation the following smart folders are set up inside public_home
smart_list_1 smart_list_2
smart_list_3 smart_list_4
smart_list_5 smart_list_6
Smart_lists are excluded from user navigation by default.
portlet_smart_list_1, portlet_smart_list_2, ..., portlet_smart_list_6
are portlets that display the search results of smart_list_(1-6)
respectively, respecting the number of items defined in the edit part of those smart folders.
These predefined portlets can be inserted into any of the slots (right_slots etc.); then the corresponding smart folders have to be created at the same folder level inside the Plone Site.
portlet_static
At installation of 1.1, 3 ATDocuments will be created inside public_home :
static_1 static_2
static_3
- The document static_1 is called by the portlet portlet_static_1, and so on.
- If the title of any of these ATDocuments is set to "no_title", then that title will not be rendered by the respective portlet.
- If an ATDocument called static_1 is created in a subfolder, portlet_static_1will call this instead of the static_1 in public_home.
- Static_portlets are excluded from user navigation by default.
- Note: Images placed in a static_portlet document will have a black border around them if the img tag is used with the class image-left: - either use image-inline or no class attribute at all.
- In beta versions of 1.1, static portlets were excluded completely - however, it was decided to keep 3 to place in the left and right slots.
portlet_vsrandomdocument
A useful feature of vsCore is the ability to place random documents in portlets. These portlets can then be placed in different parts of the site: for example, on the right slot of the Sri Chinmoy Poetry home page, a new poem is shown each time you refresh the page. To implement is relatively straightforward.
- Recent versions of Plone by default give the page short url the same as the title. Since the random images must be stored in a folder with short url name "documents", this means that the random document portlet heading will be 'Documents', which is probably not what you want. To allow a folder/page to have a short url different from the title, go to 'Preferences', click of 'Portal Settings' and click 'yes' for 'Show Short Name on Content?'. However, if this is clicked, it means each user can decide if they want this option so we have to sort that out too. In 'Preferences', select 'Personal Preferences' and check 'Allow Editing of Short Names'.
- Select the folder you wish the random document to appear in, then add an ordinary folder with short name "documents". This is the folder your documents will appear in (they must be published first) The title you give the folder will appear as the portlet header. To have no portlet header, type "#" for title. (Note never give # as short url; only as title).
- Then in the ZMI properties, chose the place for the document to appear and add the portlet. e.g. right_slots: here/portlet_vsrandomdocument/macros/portlet
- This will then display a random page from the folder documents in this portlet.
- If want it for particular folders or not, you can create properties for different sub folders.
portlet_vsrandomimage
vs_randomimage runs on the same principle as vsrandomdocuments but instead of documents, the folder in which the images are contained is called images. Again you have to publish the images inside, but the images folder itself can remain private. Add portal property: here/portlet_vsrandomimage/macros/portlet
Both portlet_vsrandomdocument and portlet_vsrandomimage call the script vsRandom - this script can also be called from inside the page template.
