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.

eZ debug

Timing: Jan 30 2025 21:15:49
Script start
Timing: Jan 30 2025 21:15:49
Module start 'layout'
Timing: Jan 30 2025 21:15:49
Module start 'content'
Timing: Jan 30 2025 21:15:49
Module end 'content'
Timing: Jan 30 2025 21:15:49
Script end

Main resources:

Total runtime0.0239 sec
Peak memory usage6,144.0000 KB
Database Queries3

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0058 588.3906151.2422
Module start 'layout' 0.00580.0039 739.6328220.7500
Module start 'content' 0.00970.0128 960.38281,001.9922
Module end 'content' 0.02250.0014 1,962.375033.9922
Script end 0.0239  1,996.3672 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.002510.5459140.0002
Check MTime0.00104.0275140.0001
Mysql Total
Database connection0.00093.757410.0009
Mysqli_queries0.002811.860230.0009
Looping result0.00000.045810.0000
Template Total0.00104.310.0010
Template load0.00083.196510.0008
Template processing0.00031.120010.0003
Override
Cache load0.00052.064510.0005
General
dbfile0.00156.130980.0002
String conversion0.00000.037940.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 1
 Number of unique templates used: 1

Time used to render debug report: 0.0001 secs