plone - Custom template for collection -
i'd create page template lists of particular content type value true.
i assume best way make custom page template collection.
so follow these instructions here: http://www.uwosh.edu/ploneprojects/docs/how-tos/a-minimalist-view-for-collections
but error "macro expansion failed" described here: page template macro expansion failed
however answer there doesn't make sense me. i'm not sure define macros, in type's .py file?
does combination of these 2 links describe whole process or more it? process described in full anywhere else?
or thinking wrong way, should not using collection, new view content type sorting itself?
you're getting error message right after paste tutorial's example code portal_skins/custom/collection_minimal_view, right?
that's because zope trying anticipate you're doing, doesn't know variable 'context' going , can't sure 'context' have 'standard_view' attribute.
at rate, if ignore error message, , follow rest of tutorial new view in fact work.
however, isn't best practice keep long term customizations in custom folder, or portal_skins, matter. better approach put template in package , register in zcml with:
<configure xmlns="http://namespaces.zope.org/zope" xmlns:browser="http://namespaces.zope.org/browser" xmlns:zcml="http://namespaces.zope.org/zcml" i18n_domain="plone"> <browser:page name="minimal_view" permission="zope2.view" for="plone.app.collection.interfaces.icollection" template="collection_minimal_view.pt" /> <browser:menuitems for="plone.app.collection.interfaces.icollection" menu="plone_displayviews"> <browser:menuitem title="minimal view" action="minimal_view" /> </browser:menuitems> </configure>
Comments
Post a Comment