Personal tools
You are here: Home Weblog Archive 2006 September 05 Override the default actions for an ArchGenXML based Archetype
Document Actions
  • Send this page to somebody
  • Print this page
  • Add Bookmarklet

Override the default actions for an ArchGenXML based Archetype

by tibi last modified 2006-09-05 12:03
Filed Under:

To specify the default view for an AT archetype the "view" action needs to be overriden. Adding a default_actions=True tagged value in the model will generate a view action that will use the base_view template. To be able to change the view action, default_actions should be deleted from the model and replaced with a base_actions=my_actions.

The my_actions statement could look like this:

my_actions = (
       {'action': 'string:${object_url}/base_edit',
        'category': 'object',
        'id': 'edit',
        'name': 'Edit',
        'permissions': ('Modify portal content',),
       },

       {'action': 'string:${object_url}/confirmationpage_view',
        'category': 'object',
        'id': 'view',
        'name': 'View',
        'permissions': ('View',),
       },
    )

Inside the class declaration, this will result in the following code:

    actions = my_actions +  (

    )

Replacing the 'view' action is the corect solution to replace the default view. If the content type is derived from ATCT or uses TemplateMixin, a 'default_view' tagged value should also be added

Weblog
Atom
RDF
RSS 2.0
Powered by Quills
Creative Commons License
This work is licensed under a Creative Commons Attribution 3.0 License.
 

Powered by Plone CMS, the Open Source Content Management System

This site conforms to the following standards: