Creation context vs Edition context

Author Message

Hakim Bouras

Friday 14 December 2007 8:12:47 am

Hello,

I would like to use the same custom "user edit template" both for the creation and the edition of my users.

From within this "user edit template" how can I detect whether I am in an edition or creation context mode ?

I tried using <i>$object.current.main_parent_node_id</i>, but the problem is if there is a validation round trip (ie: the email entered was not correct) then <i>$object.current.main_parent_node_id</i> is set ...

(Maybe using the URL : user/register vs content/edit ... but how can I check the URL ? maybe there is a smarter way... )

Thank you for your help,
Hakim

Hakim Bouras

Monday 17 December 2007 2:29:45 am

The solution I found is checking <b>$object.current.status</b> which has a value of "5" ("EZ_VERSION_STATUS_INTERNAL_DRAFT") during the creation context as long as the new user is not really created (even during validation round-trip).

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.