eZ Community » Forums » Setup & design » Disabling language selection in forum
expandshrink

Disabling language selection in forum

Disabling language selection in forum

Wednesday 10 May 2006 10:30:49 am - 16 replies

After upgrading to version 3.8, a language selection screen appears when you post a new topic to a forum. This is very confusing for the users of the forum. Is there a way to create automatically forum posts in the default language of the current siteaccess?

Modified on Tuesday 11 January 2011 9:55:59 am by Nicolas Pastorino

Wednesday 10 May 2006 10:41:12 am

Hello,

Look at this topic:
http://ez.no/community/forum/setu...f_content_creation_in_the_fronten__5

In case where you use only one siteaccess (one language) use e.g:

<input type="hidden" name="ContentLanguageCode" value="eng-GB" />

eZ publish should also skip page where user will choose language if there are no more than 1 languages.

Modified on Wednesday 10 May 2006 10:49:20 am by Łukasz Serwatka

Wednesday 10 May 2006 6:40:07 pm

I have added your code to the /design/siteaccess/override/templates/edit/forum_topic.tpl file and cleared my caches, but it still asks me for the language if I create a new forum topic. Am I using the right template?

Wednesday 10 May 2006 7:20:27 pm

Nope, you need to put it in code where you triggering object creation, look on full view template forum_topic.tpl. How many languages do you use on your site?

Wednesday 10 May 2006 8:06:17 pm

Thanks, that did the trick. As I have three languages, I used the multi-language code you gave in the other post.

Friday 12 May 2006 11:03:56 am

Is there also a way to accomplish the same for forms that are not launched through a form? E.g. the "Edit account" link, which simply links to the page

/content/edit/14

After the language selection I am on page

/content/edit/14/13/eng-GB

.

Monday 22 May 2006 8:42:02 am

Hi Jeroen

You can use

/content/edit/14/f/eng-GB

Thursday 01 June 2006 1:25:51 pm

Hello Kristof,

I try to use your solution but I get the next error:

Fatal error: Call to a member function on a non-object in D:\aperez\Workspace\Indubanda\kernel\content\attribute_edit.php on line 85
Fatal error: eZ publish did not finish its request

The execution of eZ publish was abruptly ended, the debug output is present below.

I have investigated the error and the problem is in the call to the function "eZContentObjectVersion::fetchVersion" (ezcontentobject.php - line 936). It returns an empty object for version "f".

I have upgraded my site from eZ 3.6 to eZ 3.8. Is this a bug or a problem with my database?

Thursday 01 June 2006 1:48:46 pm

Hi André

It works here, so I guess the problem is on your installation.

What kind of object are you trying to edit?

Thursday 01 June 2006 2:03:12 pm

It's a custom object, but I have the same problem with "article" and "folder" sad.gif Emoticon

Is there any script to check my database?

Tuesday 06 June 2006 10:53:23 am

I have found the problem and the solution happy.gif Emoticon It's a bug in eZp.

The problem appears when you use

/content/edit/14/f/eng-GB

and the option

EditDirtyObjectAction=usecurrent

In "kernel/content/edit.php", block code from line 348 to 363:

    if ( $ini->variable( 'ContentSettings', 'EditDirtyObjectAction' ) == 'usecurrent' )
    {
        {.......}
        $version->store();
    }

After "$version->store();", the code must be redirected to edit the new version like in line 436:

    if ( $ini->variable( 'ContentSettings', 'EditDirtyObjectAction' ) == 'usecurrent' )
    {
        {.......}
        $version->store();
        return $Module->redirectToView( "edit", array( $ObjectID, $version->attribute( "version" ), $EditLanguage ) );
    }

PS: excuse me for my poor english :P

Tuesday 06 June 2006 11:39:08 am

Hi André

Can you report it as a bug on ez.no? You can refer to this thread.

Thanks!

Wednesday 07 June 2006 8:51:51 am

Hi André

It seems that this was already reported: http://ez.no/bugs/view/8261 . It is fixed in svn.

Wednesday 07 June 2006 9:57:42 am

Good happy.gif Emoticon

Regards.

Sunday 10 December 2006 5:42:21 pm

I would like to see how one might use a user setting to control the default language setting in the way you describe.

Some kind of user setting menu to select from available languages, storage of selection, option to prompt each time.

Template logic to fetch user setting for default language to pass back to eZ publish in the way you describe.

Your thoughts on this idea?

<i>/dev/null</i>

Wednesday 21 February 2007 12:57:06 pm

/dev/null:

we have used a different approach as discussed here:
http://ez.no/community/forum/setu...choosing_language_at_publishing_time

We have created a new template:

<select name="ContentLanguageCode">
{def $site_languages=ezini('RegionalSettings', 'SiteLanguageList')}
{def $locales=fetch('content','locale_list')}
{foreach $site_languages as $lang}
         {foreach $locales as $locale}
                  {if eq($locale.locale_code, $lang)}
                      <option value="{$locale.locale_code}">{$locale.language_name}</option>
                      {break}
                  {/if}
         {/foreach}
{/foreach}
</select>

so that close to all our 'create' and 'edit' buttons we get a dropdown list to select the language we need. I think this solution makes the multilanguage function easier to use.

Monday 18 June 2007 6:52:32 pm

Also see this post... http://ez.no/community/forum/setu...osing_language_at_publishing_time__5

expandshrink

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

36 542 Users on board!

Forums menu