Setting Default Language via Category with jQuery

1 year 10 months ago - 1 year 10 months ago #62756 by iamrobert
If you use 2 languages, my clients often forget to set the correct language for the item when creating a new item and they leave it at "ALL"..

So - if I add the following code to my admin template js - it will choose English by Default.

For instance my maincat with category id 10 is "clients" and is in English.
if (window.location.href.indexOf("&maincat=10") > -1) {
$(document).ready(function(){
$("select#jform_language").val("en-GB");
});
}

You can also do it via type.
if (window.location.href.indexOf("&typeid=23") > -1) {
$(document).ready(function(){
$("select#jform_language").val("en-GB");
});
}

Please Log in or Create an account to join the conversation.

1 year 10 months ago - 1 year 10 months ago #62758 by germany_bw
You can also set default language for new items in fc-global config in TAB "item form" or alternativ for each content type an other language as default in its config. (then in TAB "Item Form FE")

Please Log in or Create an account to join the conversation.

1 year 10 months ago - 1 year 10 months ago #62765 by iamrobert
Thanks - I was more meaning - you can set it for multiple languages - which means you don't need to worry about maintaining multiple content types based on languages. Also - you can add it in FLEXIContent type - Item Form BE tab under JS.

So - you can do this:



/* CHINESE */
if (window.location.href.indexOf("&typeid=23&maincat=61") > -1) {

$(document).ready(function(){
$("select#jform_language").val("zh-TW");
$("select#jform_catid.scat").val("61");
});

}
Attachments:

Please Log in or Create an account to join the conversation.

1 year 10 months ago - 1 year 10 months ago #62766 by micker
maybe i can add this in my admin module ?
set type cat language

FLEXIcontent is Free but involves a very big effort on our part.
Like the our support? (for a bug-free FC, despite being huge extension) Like the features? Like the ongoing development and future commitment to FLEXIcontent?
-- Add your voice to the FLEXIcontent JED listing reviews. Thanks![/size]

Please Log in or Create an account to join the conversation.

1 year 10 months ago #62842 by iamrobert
Hi MIcker,

It would be awesome.

However - I don't think there is a way to pass the language through the URL:
www.flexicontent.org/forum/20-general-su...tom-url-filters.html

Thanks,

Robert

Please Log in or Create an account to join the conversation.

1 year 10 months ago #62843 by micker
i will ask to georgios about model

FLEXIcontent is Free but involves a very big effort on our part.
Like the our support? (for a bug-free FC, despite being huge extension) Like the features? Like the ongoing development and future commitment to FLEXIcontent?
-- Add your voice to the FLEXIcontent JED listing reviews. Thanks![/size]

Please Log in or Create an account to join the conversation.

Moderators: vistamediajoomlacornerggppdk
© 2018 Flexicontent. All Rights Reserved.