eZ Community » Forums » Developer » Skip language selection while...
expandshrink

Skip language selection while creating objects from frontend

Skip language selection while creating objects from frontend

Tuesday 06 March 2007 1:50:01 pm - 5 replies

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?

Tuesday 06 March 2007 2:56:50 pm

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.

Modified on Tuesday 06 March 2007 2:57:27 pm by Peter Putzer

Tuesday 06 March 2007 3:17:00 pm

Thank you Peter,

that's exactly what I needed!

Wednesday 07 March 2007 11: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

Wednesday 07 March 2007 12:14:53 pm

Hi Luca

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

Claudia

Friday 09 March 2007 4:25:29 pm

thanks Claudia,

it was perfect! blunk.gif Emoticon

Luca

expandshrink

You must be logged in to post messages in this topic!

36 542 Users on board!

Forums menu