Formlib-based content types do not show up in add menu

alv alvarot+lists at gmail.com
Tue Oct 30 10:17:26 UTC 2007


Hello,

Plone 3.0.2

I have been trying to create a very simple content type following optilude's
directions in The Book. Since I don't need fancy widgets, I was hoping to be
able to entirely avoid using AT. After the following I get the possibility
to create objects from within Clouseau's python prompt, but they're not
listed anywhere nor do I get them to appear in Plone's add menu.

1. Define interface, content type (inheriting from
plone.app.content.Container.container)
2. Create a factory, declare it as a utility in ZCML
3. Create an add view, inheriting from plone.app.form.base.AddForm, declare
it in a <browser:page zcml directive.
4. Declare this menu item:

  <browser:addMenuItem
     title="Add Field container"
     factory="Archive.formsd.FieldContainer"
     view="addFieldContainer.html"
     menu="plone_contentmenu_factory"
     description="Click to add a Field container"
     />

5. Create profiles/default/types.xml and
profiles/default/types/Field_container.xml, where the last contains this
reference to the factory:  
   <property name="content_meta_type">Field container</property>
   <property name="product"></property> 
   <property name="factory">FieldContainerFactory</property>


I can expand on any of the points if needed. A serious problem is that I
don't find any documentation for this approach. 

Rocky's "use formlib with plone" tutorial says that "add forms cannot easily
be hooked into Plone as Plone feels it needs to create the content first
before displaying any forms" (dec 2006).

Does this mean I need to notify "portal_factory" of my new type? Maybe in
the meanwhile this problem has been solved?

I would be very grateful for any pointers on how to get unstuck, in fact I
can turn the hints into documentation if/when I succeed.

Best,

Álvaro.

 


-- 
View this message in context: http://www.nabble.com/Formlib-based-content-types-do-not-show-up-in-add-menu-tf4717509s20094.html#a13485600
Sent from the Product Developers mailing list archive at Nabble.com.





More information about the Product-Developers mailing list