overiding expirationDate and order of fields in archetype schema/ base_edit

3 Messages Forum Options Options
Permalink
Rick Hurst
overiding expirationDate and order of fields in archetype schema/ base_edit
Reply Threaded More
Print post
Permalink
Hi,

I have overidden expirationDate in my archetypes schema (i.e. changed
the widget label and description), but the field does not appear in
the place I would like it to in base edit - all the other fields apper
in the order specified in the schema, but the expirationDate appears
after the description field, 3 places in the schema too soon! Can
anyone tell me how to get it to appear in my desired position.

This is a Plone 3.1.2 site. I have inherited it rather than built it
from scratch, so there may be something elsewhere influencing where
this appears, but I haven't spotted it.

--
Rick Hurst, Web developer, Bristol, England
http://www.rickhurst.co.uk

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Plone-Users mailing list
Plone-Users@...
https://lists.sourceforge.net/lists/listinfo/plone-users
Stefan Lange-3
Re: overiding expirationDate and order of fields in archetype schema/ base_edit
Reply Threaded More
Print post
Permalink
Am Freitag, den 25.07.2008, 10:19 +0100 schrieb Rick Hurst:

> Hi,
>
> I have overidden expirationDate in my archetypes schema (i.e. changed
> the widget label and description), but the field does not appear in
> the place I would like it to in base edit - all the other fields apper
> in the order specified in the schema, but the expirationDate appears
> after the description field, 3 places in the schema too soon! Can
> anyone tell me how to get it to appear in my desired position.
>
> This is a Plone 3.1.2 site. I have inherited it rather than built it
> from scratch, so there may be something elsewhere influencing where
> this appears, but I haven't spotted it.
>
Hi Rick,

if you want to move a field to a new position you could write the
following line of code inside your content class:

schema.moveField('expirationDate', before = '<other field>')

Give a look at the method definition in
Products.Archetypes.Schema.__init__.py.

HTH,

Stefan


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Plone-Users mailing list
Plone-Users@...
https://lists.sourceforge.net/lists/listinfo/plone-users

signature.asc (196 bytes) Download Attachment
Rick Hurst
Re: overiding expirationDate and order of fields in archetype schema/ base_edit
Reply Threaded More
Print post
Permalink
On Fri, Jul 25, 2008 at 11:07 AM, Stefan Lange
<stef.lange@...> wrote:


> schema.moveField('expirationDate', before = '<other field>')
>
> Give a look at the method definition in
> Products.Archetypes.Schema.__init__.py.
>

Thanks Stefan - that did the trick :)

--
Rick Hurst, Web developer, Bristol, England
http://www.rickhurst.co.uk

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Plone-Users mailing list
Plone-Users@...
https://lists.sourceforge.net/lists/listinfo/plone-users