Path

ez.no / ezpublish / documentation / incoming / http post to url conversion


HTTP Post to URL conversion

These documentation pages are no longer maintained. Please visit the new documentation site.

Available from version 3.5

This will explain how to use forms to create URLs.

Input variables :

  • DestinationURL - base of the URL.
  • Param - Any input variable with the name Paramsometing will get the value added to the url.
  • Submit - parameter will be ignored.
  • All other parameters will be added with the /[name]/[value]

Example :
In the template for the node ez_publish/news/test:

<form action={"content/action"|ezurl} method="post">

<input type="hidden" name="DestinationURL" value="{$node.url_alias|ezurl(no)}" />

<input type="checkbox" name="(year)" value="1999" /> <br />

<input type="checkbox" name="(month)" value="12" /> <br />

<input type="submit" name="Submit" value="Go" />

</form>

The result will be automatic redirection to: ez_publish/news/test/(year)/1999/(month)/12 if both checkboxes are checked.

Operator Description

Comments

ezurl not neccesary

i had trouble with the value of 'DestinationURL'. when pipeing .url_alias into ezurl operator i got an blank page/wrong url. skipping it got the right result. eZP 3.6.0

So multiple submits _are_ possible?

Does that mean that only a post variable named "Submit" is ignored? In other words: if the submit button is named "EditButton", will it be ignored or not?

If names other than "Submit" are not ignored, it should be possible to do what Paul said, simply by giving the submits a new name.

--
Hans

Ignoring submit button

The reason for this is because the submit input is basicly just UI. The name must be Submit, and it's value is the name of the button. Adding the submit info to the url will in most cases just mess things up.

You'll probably be able to solve your problem using multiple forms and hidden input.

--
Kåre Høvik

Is there a reason why the submit parameter is ignored?

This can be handy if you have more than one submit button to minimise the required user input.

Regards

-paul