Setting Default Language via Category with jQuery

More
8 years 6 months ago - 8 years 6 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.
Code:
if (window.location.href.indexOf("&maincat=10") > -1) { $(document).ready(function(){ $("select#jform_language").val("en-GB"); }); }

You can also do it via type.
Code:
if (window.location.href.indexOf("&typeid=23") > -1) { $(document).ready(function(){ $("select#jform_language").val("en-GB"); }); }
Last edit: 8 years 6 months ago by iamrobert.

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

More
8 years 6 months ago - 8 years 6 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")
Last edit: 8 years 6 months ago by germany_bw.

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

More
8 years 6 months ago - 8 years 6 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:



Code:
/* 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:
Last edit: 8 years 6 months ago by iamrobert.

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

More
8 years 6 months ago - 8 years 6 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]
Last edit: 8 years 6 months ago by micker.

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

More
8 years 6 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.

More
8 years 6 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
Time to create page: 0.352 seconds
Save
Cookies user preferences
We use cookies to ensure you to get the best experience on our website. If you decline the use of cookies, this website may not function as expected.
Accept all
Decline all
Essential
These cookies are needed to make the website work correctly. You can not disable them.
Display
Accept
Analytics
Tools used to analyze the data to measure the effectiveness of a website and to understand how it works.
Google Analytics
Accept
Decline