Forums / Setup & design / edit and view parameters
laurent le cadet
Tuesday 06 November 2007 10:43:58 am
Hi,
I just can write (as it's no really documented) the correct syntaxe for an edit form mix with view parameters :
<form method="post" action={"content/action"|ezurl} > +++ ...(product)/$product.... ....</form>
Any help will save my life.
Regards.
Laurent
Xavier Dutoit
Tuesday 06 November 2007 12:54:41 pm
I'd love to save your life, but not sure I got what you're trying to do.
Could you elaborate on your goal (for the sake of your life ;) ?
X+
http://www.sydesy.com
Wednesday 07 November 2007 12:01:56 am
Xavier,
The form + var:
{def $product = $object.data_map.name.content|wash() } <form method="post" action={"content/action"|ezurl} > <input type="hidden" name="ContentLanguageCode" value="{ezini( 'RegionalSettings', 'Locale' , 'site.ini')}" /> <input type="hidden" name="ClassIdentifier" value="information" /> <input type="hidden" name="NodeID" value="{$object.main_node.parent.node_id}" /> <input type="image" class="btn-info-produit" src={"1x1.gif"|ezimage} name="NewButton" /> </form>
...which generate the regular url: http://217.147.200.104/fr/content/edit/6920/1
I would like to have this one: http://217.147.200.104/fr/content/edit/6920/1/(product)/The name of a product
If I'm right, "The name of a product" can be find in the ask edition template (let's say edit/information.tpl) as {$view_parameters.product}
I think I have to change the form's action (?) or maybe it's not the correct usage...
Laurent (still alive ;)
Wednesday 07 November 2007 5:52:09 am
ok, I nerver used the view parameter on edit, let us know if it works
otherwise action="{"content/action")|ezurl("no")}/(product)/xxx" should do it
Wednesday 07 November 2007 7:14:27 am
:(
I tryed it :
<form method="post" action="{"content/action")|ezurl("no")}/(product)/{$product}" >
which print this (source):
<form method="post" action="content/action/(product)/Test product" >
but just hit this address:
http://000.000.000.000/fr/content/edit/6963/1
But at it is say here (http://ez.no/doc/ez_publish/technical_manual/3_9/templates/basic_template_tasks), it should be possible.
André R.
Wednesday 07 November 2007 12:59:59 pm
I haven't used myself, but you might be more successful in doing it more directly against content/edit like this:
{"content/edit/13/f/eng-GB/(color)/green/(amount)/34"|ezurl}
Where 13 is the contentobject_id
EDIT: this doesn't work when you create a new node of course, I only briefly looked at your question before posting :/Might want to add a enhancement issue on this, because it doesn't seems like content/action supports view parameters.
eZ Online Editor 5: http://projects.ez.no/ezoe || eZJSCore (Ajax): http://projects.ez.no/ezjscore || eZ Publish EE http://ez.no/eZPublish/eZ-Publish-Enterprise-Subscription @: http://twitter.com/andrerom
Wednesday 07 November 2007 11:26:25 pm
André,
So it looks like there is noway to use $view_parameters while creating a NEW object.
Thanks.
Ole Marius Smestad
Thursday 08 November 2007 2:26:12 am
usage of user parameters in content/action is currently not supported. It will only work when used directly on content/edit.
-- Best regards,Ole Marius
-- Ole Marius Smestad Lead Engineer eZ Publish Member of the Community Project Board
Thursday 08 November 2007 2:33:32 am
Thanks for precisions.