Help - move text field of behavior IRichTextBehavior.text in edit form

hi,

I have such schema

class IDPage(model.Schema):
    directives.write_permission(superior='cmf.ModifyPortalContent')
    superior = schema.TextLine(
        title=_(u'Superior'),
        required=False,
    )
	#.....

and I turn on plone.richtext behavior for DPage,
i need to move the text field from plone.richtext behavior
just before 'superior' field defined in my schema.

some kind of this code?
directives.order_before(IRichTextBehavior.text='superior') # i can not make this work, even correctly syntax

Many thanks for your time.

Maybe you could just drop the behavior and add a field with the same name (I think that works 'just as well')

thx for the idea! @espenmn

I believe you have the order of these incorrect — you want the name of the parameter to be superior and the value of the string argument to be IRichTextBehavior.text, so this should look like either:

directives.order_before(superior='IRichTextBehavior.text')

or more likely, if I understand your intention:

directives.order_after(superior='IRichTextBehavior.text')

Another way to look at this: your directive (predicate) here is about (subject) your field, in relation to (object) other behavior's field — the tagged values saved by the directives that are used to convey this to the form are following along these lines.

...as with many things in Plone documentation, there's a lot of gold left hanging out in documentation for older versions that should be a place to consult when something is not clear or not working. For fundamental stuff like this, Plone 5 docs on form directives are probably more a good complement to Plone 6 docs on the same topic