How do I order IDublinCore behavior in an agility type?

I am writing a product using the Python Dexterity Type, and I have a Title and Description , these fields come from the behavior of plone.app.dexterity.behaviors.metadata.IDublinCore , but I rewrite these fields with my fields.

Example:

My fields: document, collage, age, biography

IDublinCore: Name, Description

Order: collage, title, document, age, biography, description

How am i doing this?

+5
source share
2 answers

Since you have your own type of Dexterity, you can handle using form directives aka setting taggedValues on the interface.

 from plone.autoform import directives class IYourSchema(model.Schema): directives.order_before(collage='IDublinCore.title') collage = schema.TextLine( title=u'Collage', ) 

You will find excellent documentation about this feature in the plone documentation http://docs.plone.org/external/plone.app.dexterity/docs/reference/form-schema-hints.html#appearance-related-directives

+5
source

How about using jQuery? (Since field sets use jquery anyway)

For example, to move tags in the Summary section ....

 $('body.template-edit.portaltype-document #formfield-form-widgets-IDublinCore-subjects').insertAfter('#formfield-form-widgets-IDublinCore-description') 

Note. This is a copy of my answer here.

0
source

Source: https://habr.com/ru/post/1258356/


All Articles