Language switcher on the top (menu)

Rate this topic: Evaluations: 1, 1.00 on the average.Evaluations: 1, 1.00 on the average.Evaluations: 1, 1.00 on the average.Evaluations: 1, 1.00 on the average.Evaluations: 1, 1.00 on the average.Evaluations: 1, 1.00 on the average.1.00 out of 6 based on 1 vote(s)
GK User
Sun Jan 05, 2014 11:11 pm
Reply with quote
Report this post
Hi I tried to make a new module with the Language switcher and set the position to lang but it doesn't shows the flags...

I tried with the position of header but it still shows nothing...

Please help me I want it to be next to the menu and the login...

Kind Regards

Goran
MICROweb
User avatar
Senior Boarder

teitbite
Mon Jan 06, 2014 7:36 pm
Reply with quote
Report this post
Hi

You need to create such module position first becuase it was not designed.

Please edit file /layout/default.php and add this code in line 75, righ before the code for login module.

Code: Select all
                        <?php if($this->API->modules('lang')) : ?>
                        <jdoc:include type="modules" name="lang" style="raw" />
                        <?php endif; ?>


Publish language switcher an show me the site than.
User avatar
Moderator

GK User
Tue Jan 07, 2014 3:44 pm
Reply with quote
Report this post
I have copied the code for the default.php file and pasted it where you said ...

I enabled the language switcher and set the position on the tube ....

But it is still not showing flags or any title


Kind Regards

Goran
MICROweb
User avatar
Senior Boarder

teitbite
Fri Jan 10, 2014 5:09 am
Reply with quote
Report this post
Hi

Looks of for now. Please show me the site so I'll check where flags are hidding.
User avatar
Moderator

GK User
Sat Jan 11, 2014 9:00 pm
Reply with quote
Report this post
Hi teitbite..

The site is http://xarisphoto.gr/index.php/el/

Best Regards


Goran
MICROweb
User avatar
Senior Boarder

GK User
Sun Jan 12, 2014 2:31 am
Reply with quote
Report this post
does someone have a german lang-file please?
User avatar
Fresh Boarder

teitbite
Tue Jan 14, 2014 4:31 am
Reply with quote
Report this post
Hi

Ok. Module is there, but has to be wrongly configured since there is no content in it. Please send me an access to joomla panel so I'll see what is missing.
User avatar
Moderator

GK User
Tue Jan 14, 2014 9:22 am
Reply with quote
Report this post
teitbite wrote:Hi

You need to create such module position first becuase it was not designed.

Please edit file /layout/default.php and add this code in line 75, righ before the code for login module.

Code: Select all
                        <?php if($this->API->modules('lang')) : ?>
                        <jdoc:include type="modules" name="lang" style="raw" />
                        <?php endif; ?>


Publish language switcher an show me the site than.


Actually in Creativity template (last version under Joomla 3.2) I saw that there is already predefined such a module position lang. So Maybe you just need to change its place. By default its published under the footer position. So moved in next to the main menu position


Hope this will helped and will not needed to create new module position for the language switcher
User avatar
Fresh Boarder

GK User
Tue Jan 14, 2014 9:46 am
Reply with quote
Report this post
OK Here is how I solved the problem. Moderators will say if all is correct ;)

First as I wrote in my previous post in the template (template->layout->default.php) there is already a position lang , which can be used for placing the language switcher module. So you have two options :

1. to create a new module position , for example: languages, as teitbite describerd:

Please edit file /layout/default.php and add this code in line 75, righ before the code for login module.
Code: Select all
<?php if($this->API->modules('languages')) : ?>
                        <jdoc:include type="modules" name="lang" style="raw" />
                        <?php endif; ?>


And after that to style it with css ( will show you later how)

2. the other option is to open again in templates->layout/default.php and to serach for the module position "lang" at around line 190

Code: Select all
<?php if($this->API->modules('lang')) : ?>
        <div id="gkLang" class="gkPage">
                <jdoc:include type="modules" name="lang" style="<?php echo $this->module_styles['lang']; ?>" />
        </div>
        <?php endif; ?>

You can comment or delete this code.

It will looks like:
Code: Select all
<?php $this->layout->loadBlock('footer'); ?>
        <!--<?php if($this->API->modules('lang')) : ?>
        <div id="gkLang" class="gkPage">
                <jdoc:include type="modules" name="lang" style="<?php echo $this->module_styles['lang']; ?>" />
        </div>
        <?php endif; ?>-->


After that on the same file after the line 75 moved the lang position (nothing new from the option 1), right after the login module.
Code: Select all
<!--My Language position-->
            <?php if($this->API->modules('lang')) : ?>
        <div id="gkLang">
                <jdoc:include type="modules" name="lang" style="<?php echo $this->module_styles['lang']; ?>" />
        </div>


As you see from the copied code from the bottom , that we removed the class="gkPage" as we don't needed it here. Save the default.php file, and you will see that you already have your lang position on the top (left) of the template. Now let us style it a little. Add the next css code in your template.css file

Code: Select all
#gkLang {
float: right;
padding-top: 25px;
}


After that you will see that the language switcher is on the right side of the main menu.

Hope this will help, and let me now if I did something which is not correct :)
User avatar
Fresh Boarder

teitbite
Thu Jan 16, 2014 4:45 am
Reply with quote
Report this post
Hi

Yes, that's a detailed instruction of adding a new module position for langage selector and styling it to move to a proper position. Thank You for posting that. I hope other users will benefit from it :)
User avatar
Moderator

GK User
Thu Jan 16, 2014 11:36 am
Reply with quote
Report this post
Glad that I could help ;)
User avatar
Fresh Boarder


cron