Custom ATContentType with its own folder view

classic Classic list List threaded Threaded
4 messages Options
Bill Rye Bill Rye
Reply | Threaded
Open this post in threaded view
|

Custom ATContentType with its own folder view

I'm trying to create a custom ATContentType that is basically a
folder, but I want to display the contents as a single page, not
the summary view.  I found
http://plone.org/documentation/how-to/display-all-richdocuments-of-a-folder-as-one/view?searchterm=custom%20folder%20view
but I would like to have the view set as part of the product
package and not something that I have to go through ZMI to setup.

Any examples on how to do that?

Thanks in advance,
Bill



-------------------------------------------------------
This SF.Net email is sponsored by the JBoss Inc.  Get Certified Today
Register for a JBoss Training Course.  Free Certification Exam
for All Training Attendees Through End of 2005. For more info visit:
http://ads.osdn.com/?ad_id=7628&alloc_id=16845&op=click
_______________________________________________
Plone-Users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/plone-users
Luca Olivetti-4 Luca Olivetti-4
Reply | Threaded
Open this post in threaded view
|

Re: Custom ATContentType with its own folder view

En/na Bill Rye ha escrit:
> I'm trying to create a custom ATContentType that is basically a
> folder, but I want to display the contents as a single page, not
> the summary view.  I found
> http://plone.org/documentation/how-to/display-all-richdocuments-of-a-folder-as-one/view?searchterm=custom%20folder%20view 
>
> but I would like to have the view set as part of the product
> package and not something that I have to go through ZMI to setup.
>
> Any examples on how to do that?

This is for archetypes, I'm not sure if it is exactly the same for atct
but it probaly is:
put the template in your product skin and assign it as the default_view
and immediate_view in the class definition.
Another option is to do nothing in the class definition and, e.g., if
your portal_type is named MyPortalType create a template named
myportaltype_view.pt and inside that define the macros "body" and
"folderlisting" and archetypes will use those to show the body and the
folder listing of your object instead of the default ones.

Bye

--
Luca Olivetti
Wetron Automatización S.A. http://www.wetron.es/
Tel. +34 93 5883004      Fax +34 93 5883007


-------------------------------------------------------
This SF.Net email is sponsored by the JBoss Inc.  Get Certified Today
Register for a JBoss Training Course.  Free Certification Exam
for All Training Attendees Through End of 2005. For more info visit:
<a href="http://ads.osdn.com/?ad_idv28&alloc_id845&op=click">http://ads.osdn.com/?ad_idv28&alloc_id845&op=click
_______________________________________________
Plone-Users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/plone-users
Martin Aspeli-2 Martin Aspeli-2
Reply | Threaded
Open this post in threaded view
|

Re: Custom ATContentType with its own folder view

In reply to this post by Bill Rye
On Tue, 22 Nov 2005 01:36:02 -0000, Bill Rye  
<[hidden email]> wrote:

> I'm trying to create a custom ATContentType that is basically a
> folder, but I want to display the contents as a single page, not
> the summary view.  I found  
> http://plone.org/documentation/how-to/display-all-richdocuments-of-a-folder-as-one/view?searchterm=custom%20folder%20view
> but I would like to have the view set as part of the product
> package and not something that I have to go through ZMI to setup.
>
> Any examples on how to do that?

If you're really only talking about a view of a folder, the method  
prescribed in that tutorial is probably the best idea, letting you use the  
"display" menu to choose which folders have the contents' view. Note,  
however, that such aggregation is a bit tricky, unless you also restrict  
the types in the folder, as the above how-to does, since you don't know  
how to display every content type (i.e. not every type has a "getText"  
accessor to get the body text).

You can use a skin product (see DIYPloneSkin tutorial) and set up the new  
template in the Install.py, meaning no ZMI interaction. Probably best  
always.

Alternatively, you can derive a content type from ATFolder (see  
RichDocument tutorial) and set:

        default_view = 'my_view'
        suppl_views = ()

on the class, where my_view is the template. This will make this template  
the view of the folder.

Martin
--
(muted)



-------------------------------------------------------
This SF.Net email is sponsored by the JBoss Inc.  Get Certified Today
Register for a JBoss Training Course.  Free Certification Exam
for All Training Attendees Through End of 2005. For more info visit:
http://ads.osdn.com/?ad_id=7628&alloc_id=16845&op=click
_______________________________________________
Plone-Users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/plone-users
Bill Rye Bill Rye
Reply | Threaded
Open this post in threaded view
|

Re: Custom ATContentType with its own folder view

In reply to this post by Bill Rye
Bill Rye wrote:

> I'm trying to create a custom ATContentType that is basically a
> folder, but I want to display the contents as a single page, not
> the summary view.  I found
> http://plone.org/documentation/how-to/display-all-richdocuments-of-a-folder-as-one/view?searchterm=custom%20folder%20view 
>
> but I would like to have the view set as part of the product
> package and not something that I have to go through ZMI to setup.
>
> Any examples on how to do that?
>
> Thanks in advance,
> Bill

Answered my own question.  I just wasn't thinking when I posted this.
Thanks for all the all help.



-------------------------------------------------------
This SF.Net email is sponsored by the JBoss Inc.  Get Certified Today
Register for a JBoss Training Course.  Free Certification Exam
for All Training Attendees Through End of 2005. For more info visit:
http://ads.osdn.com/?ad_id=7628&alloc_id=16845&op=click
_______________________________________________
Plone-Users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/plone-users