Re: CMFDynamicFTI Quirks

"Martin Aspeli" <[email protected]>
Newsgroups gmane.comp.web.zope.plone.archetypes.devel
Message-ID <[email protected]>
On Wed, 04 Jan 2006 22:26:27 -0000, jordan  
<[email protected]> wrote:

> I'm trying to implement selectable templates for my AT-based content
> (generated with AGX).
>
> Using Plone 2.1.1, CMFDynamicFTI 1.0.1.
>
> So using suppl_views I have been able to register what templates I
> want to display and that part works great.  I can select which
> template I want to use.  I set immediate_view and default_view to my  
> custom
> template.
>
> However it doesn't actually change after it gets selected.  It always
> returns back to base_view.
>
> It appears that even though the default view is successfully changed
> (verified in test cases), the selectViewTemplate python method uses
> CMFFormController to redirect_to_action of 'view'.  And this is always
> defaulting to 'base_view' which I don't want.
>
> Any advice for getting my custom template to display after selecting
> it from the "Display" dropdown?  Thanks in advance...

Yes, you need to set up the proper view actions. If you use an  
ATContentTypes base class, you'll get this for free, otherwise you need  
set the view actions like they are in ATContentTypes' base classes, e.g.

view -> string:${object_url}
edit -> string:${object_url}/edit
metadata -> string:${object_url}/properties
local_roles -> string:${object_url}/sharing

Then you need to set up method aliases (this is where CMFDynamicViewFTI  
gets invoked)

(Default) -> (dynamic view)
view -> (selected layout)
edit -> base_edit (or atct_edit if you're deriving from ATContentTypes)
properties -> base_metadata
sharing -> folder_localrole_form

Martin

-- 
(muted)



-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.