Sign in to follow this  
Followers 0
Ramesh

How to set language automatically in Joomla frontpage article submission?

2 posts in this topic

Hi,

This is not related to bowthemes. But, I am posting here as bowthemes team has excellent knowledge in Joomla.

I have created multilanguage site in Joomla. Default language is English, second language is French.

I created user login module and front end article submission for both languages.

I registered a user in English site (front end) and logged in English site. I clicked on 'Submit an article'.

In 'Submit an article' page, language is displayed as 'All'. I want this to be displayed as 'English' as the user is logged into English website.

If the user is logged into French website, Language should be automatically set to French.

Instead of selecting the language manually, I want to set it automatically to the language the user logged in. Because most of the time, user forgets to select the language.

Can someone please help to achive this?

Regards,

Ramesh.

Share this post


Link to post
Share on other sites

Hello Ramesh,

You need modify code for this layout. Please find and replace the old code:

<?php echo $this->form->getInput('language'); ?>

with new code:

<?php

$lang = JFactory::getLanguage();

echo $this->form->getInput('language', null, $lang->getTag());

?>

Best regards,

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  
Followers 0