Forums / General / How do you pass variables through the object creation/publish machinery?

"Please Note:
  • At the specific request of Ibexa we are changing this projects name to "Exponential" or "Exponential (CMS)" effective as of August, 11th 2025.
  • This project is not associated with the original eZ Publish software or its original developer, eZ Systems or Ibexa".

How do you pass variables through the object creation/publish machinery?

Author Message

nigel dodd

Friday 04 February 2005 3:22:57 am

Take the tscm example http://www.ez.no/ez_publish/documentation/building_an_ez_publish_site/the_guestbook/adding_an_action_button where a guestbook object is initially created using content/action with the NewButton input. This results in the appearance of an editing template for the user to fill in the various attribute values of the guestbook class. This can be overridden, as demonstrated in the documentation, to provide a bespoke editing form.

If I had a variable in the template containing the content/action form, how would I be able to pass this value to the edit template? The normal appending of /(myvariable)/myvalue to the url does not work here.

nigel dodd

Friday 04 February 2005 9:28:50 am

Use the hack
http://ez.no/community/contribs/hacks/one_click_new_object_and_publish_preview_hack
which eliminates the need for the two stage creation/publish of content/action NewButton and replaces it with a single stage where the relevant variables are available and can be inserted into attribute values.

I would suggest that a more fully coded version of this excellent "hack" finds its way into the release code. It needs extending to accomodate other variable types than just text variables. I shall endeavour to do so for integers and post the result.