Plone and Dexterity - How can I add a form for one of my content types to my page?

396 views Asked by At

So I have a web page that has to do with games. I want users to be able to add information about their own games to this website. I have a tab called "Add A Game". When a user clicks on this tab I would like a form to appear which they can fill out to add information about their game. I am using Dexterity. When I am logged in as "admin" I can go to "Site Setup" and then "Dexterity Content Types" and add new types or new fields to an existing type. Now that I have added a type called "game" I would like the form that I use as admin to also be available to any user under the "Add A Game" tab. How can I accomplish this?

2

There are 2 answers

10
pabo On
  1. Add a folderish Dexterity Content type "Games" and add an instance of "Games" in your portal. This should be the container for user generated games. Here they get the permission to add content as anonymous.
  2. Go to the ZMI and add a cmf action "add a game" (http://localhost:8080/plone/portal_actions/portal_tabs/manage_main)
  3. The url of the action should be: string:${globals_view/navigationRootUrl}/games/++add++game (the link address of the "add game" link) (http://localhost:8080/plone/portal_actions/portal_tabs/add%20a%20game/manage_propertiesForm)

Now you are able as an admin to create games in your folder "games". The permission to create a game as anonymous user is adjusted in workflows.

  1. Copy the "one state workflow" in portal_workflows (http://localhost:8080/plone/portal_workflow/manage_main)
  2. at the tab "Permissions" of your newly created workflow you can add the managed permission "Add portal content".
  3. At the tab "States" you find the only state of your workflow "published". Click on it. At the tab "Permissions" you can grant "Add portal content" to Anonymous.
  4. go to portal_workflow (http://localhost:8080/plone/portal_workflow/manage_selectWorkflows) and assign the new workflow to the new folderish content type "games".

Now anonymous are able to create a game in games. But anonymous cannot see their game. But you can choose or/and adjust a workflow for the content type "game" to assign the "view" permission to everybody.

0
Ida On

The permission for logged-in to add a game can be achieved by setting it via the sharing-tab of the 'games'-folder in the green edit-bar (click 'Add' permission for auth.Users), no need to touch workflows.

For adding a 'Add game'-Tab in the main menu, do as adviced by pabo.