How to create default content in Member Area
This How-to applies to:
Plone 2.5.x
This How-to is intended for:
Server Administrators, Integrators, Customizers, Developers
Purpose
Suppose you want some default content placed in new members' home folder, just to help them along or because your site requires it for some purpose. For my use case, i want them to have a Bookmarks folder, hoping that this will draw their attention to this possibility.
Prerequisities
You should have knowledge about creating customized content types, and about adding content programmatically. This how-to is intended for use with Plone 2.5.
Step by step
- Via the ZMI, go to the portal_skins folder and select the custom folder.
-
Add a notifyMemberAreaCreated script. This gets called by membership_tool when a new member first logs in. (Actually it gets called on the newly created member folder, acquisition will find the custom script.)
# script to automatically create bookmarks folder in member's user area context.plone_log("Post create script running") bmId = 'bookmarks' bmTitle = 'My Bookmarks' context.invokeFactory('BookmarkFolder',id=bmId) bmfolder = getattr(context, bmId) bmfolder.setTitle(bmTitle) bmfolder.reindexObject()For this example to work, you should have ATBookmarks installed, otherwise, change it to Folder.