Jump to content

Language field on mobile header


kmk

Recommended Posts

Posted

I try and try searching for this feature, because my portal members are 2 groups languages people, and mayority use phone to navigate.

Right now the language field is set up end of page, any solution can put the language field option in the header? and thank for any tip.

languagemobile.PNG

Posted

Thank you @newbie LAC

I have not knowledge to handly code, but I try and do something:), and work...but not perfect..

Is possible replace the Language word by an icon to represent language option?

languagecodenavbar.PNG

languagecodenavbar3.PNG

languagecodenavbar2.PNG

Posted

You could always try the plugin that was linked to above - seems to meet your needs a little as it a) provides the choice and b) provides function to display icons (ie the country flag)

Might need some jiggery-pokery to get it to display in the header on mobile - will take a look later tonight to see what can be done.

Posted

I try again, put it in mobileNavegation, but I do not how can make it center and give it a color visible.

{{$languages = \IPS\Lang::getEnabledLanguages();}}
	{{if count( $languages ) > 1}}
		<li>
			<a href='#elNavLang_menu' id='elNavLang' data-ipsMenu data-ipsMenu-above>{lang='language'} <i class='fa fa-caret-down'></i></a>
			<ul id='elNavLang_menu' class='ipsMenu ipsMenu_selectable ipsHide'>
			{{foreach $languages as $id => $lang }}
				<li class='ipsMenu_item{{if \IPS\Member::loggedIn()->language()->id == $id || ( $lang->default && \IPS\Member::loggedIn()->language === 0 )}} ipsMenu_itemChecked{{endif}}'>
					<form action="{url="app=core&module=system&controller=language" noprotocol="true" csrf="true" seoTemplate="language"}" method="post">
					<button type='submit' name='id' value='{$id}' class='ipsButton ipsButton_link'>{{if $lang->get__icon()}}<i class='{$lang->get__icon()}'></i> {{endif}}{$lang->title} {{if $lang->default}}{lang="default"}{{endif}}</button>
					</form>
				</li>
			{{endforeach}}
			</ul>
		</li>
	{{endif}}

 

languagecodenavbar5.PNG

languagecodenavbar6.PNG

Posted
15 hours ago, kmk said:

Is possible replace the Language word by an icon to represent language option?

find

{lang='language'}

change to

<i class='fa fa-language'></i>

 

2 hours ago, kmk said:

I try again, put it in mobileNavegation, but I do not how can make it center and give it a color visible.

Add css classes to 

			<a href='#elNavLang_menu' id='elNavLang' data-ipsMenu data-ipsMenu-above>

Example "Sign Out" has 

ipsButton ipsButton_light ipsButton_small ipsButton_fullWidth

 

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...