Skip language selection while creating objects from frontend

Author Message

Jonas Fischer

Tuesday 06 March 2007 4:50:01 am

Hi,

my website visitors can create some objects. The whole site is available in 2 languages but the user generated objects should only exist in one default language. However, when the user clicks on the button to create a new object he first has to "Select the language in which you want to create an object". How can I avoid this language selection screen, so that the user sees directly the input fields to create his object?

I hope you can help me?

Peter Putzer

Tuesday 06 March 2007 5:56:50 am

Just add the following line to your template:

<input type="hidden" name="ContentLanguageCode" value="{ezini('RegionalSettings', 'Locale')}" />

Of course you can also use a fixed language code instead of the call to ezini.

Accessible website starting from eZ publish 3.0 (currently: 4.1.0): http://pluspunkt.at

Jonas Fischer

Tuesday 06 March 2007 6:17:00 am

Thank you Peter,

that's exactly what I needed!

luca maroni

Wednesday 07 March 2007 2:25:26 am

yes this is work when you create a new object. It's possible to do something similar when you edit an existing object.

Inside my template I inserted a button to edit a page directly from the site:

{section show=$node.object.can_edit}
<form method="post" action={concat("/content/edit/", $node.object.id)|ezurl}>
<input class="button" type="submit" name="editButton" value="edit page" />
</form>
{/section}

This code works, but before to edit the page the system ask me what language I want to edit.

It's possible avoid also this language selection screen??
I tried to insert the line :
<input type="hidden" name="ContentLanguageCode" value="{ezini('RegionalSettings', 'Locale')}" />

but nothing, the system asks me always to choose what language edit!!

any idea?

thanks a lot
Luca

Claudia Kosny

Wednesday 07 March 2007 3:14:53 am

Hi Luca

Just check here http://ez.no/community/forum/setup_design/disabling_language_selection_in_forum
(somewhere in the middle of the thread)

Claudia

luca maroni

Friday 09 March 2007 7:25:29 am

thanks Claudia,

it was perfect! ;-)

Luca

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