Forum

Forum - DatingScript

Online dating software

You are not logged in.

#1 2017-06-09 08:36:01

mydaghestan
Member

Language-flags on homepage in header (on top)

Any suggestion how to show flags  for different languages on top of the page (by default it is at the bottom and very small, almost invisible)? Thanks a lot.

Offline

#2 2018-10-21 15:33:28

dating4ababy
Member

Re: Language-flags on homepage in header (on top)

That would be very useful if it was a default feature.
Thanks

Offline

#3 2018-10-21 16:58:15

matrimo
Member

Re: Language-flags on homepage in header (on top)

You will need to edit your templates/header.php file for that and add the flags, from footer.php

Offline

#4 2018-10-21 18:46:59

dating4ababy
Member

Re: Language-flags on homepage in header (on top)

Many thanks. The problem is where to edit. I tried a couple of times, I'm not expert at coding, and didn't get a good result, see http://my.dating4ababy.com/
Wouldn't it be possible to have this editable from DS control panel, instead of having to edit the files?
Thanks

Offline

#5 2018-10-21 18:57:28

matrimo
Member

Re: Language-flags on homepage in header (on top)

In header.php, after the logo, before the first banner

add this code

	<footer id="footer">
		<div class="container">
			<div class="row">
				<div class="col-ms-12">
					<? if ( config::item('language_flags', 'template') && !config::item('language_override', 'system') && count(config::item('languages', 'core', 'keywords')) > 1 || config::item('site_legal', 'navigation') || config::item('branding_text', 'system') ): ?>
						<div class="credits">
							<? if ( config::item('language_flags', 'template') && !config::item('language_override', 'system') && ( count(config::item('languages', 'core', 'keywords')) > 1 || input::demo(0, '', false) ) ): ?>
								<div class="languages">
									<ul>
										<? if ( input::demo(0, '', false) ): ?>
											<li class="english"><?=html_helper::anchor('users/?language=english', html_helper::image('assets/images/system/flags/us.svg', array('title' => 'English', 'data-tooltip' => 'default', 'data-position-my' => 'bottom center', 'data-position-at' => 'top center', 'width' => 22, 'height' => 22)))?></li>
											<li class="french"><?=html_helper::anchor('users/?language=french', html_helper::image('assets/images/system/flags/fr.svg', array('title' => 'French', 'data-tooltip' => 'default', 'data-position-my' => 'bottom center', 'data-position-at' => 'top center', 'width' => 22, 'height' => 22)))?></li>
											<li class="dutch"><?=html_helper::anchor('users/?language=dutch', html_helper::image('assets/images/system/flags/nl.svg', array('title' => 'Dutch', 'data-tooltip' => 'default', 'data-position-my' => 'bottom center', 'data-position-at' => 'top center', 'width' => 22, 'height' => 22)))?></li>
											<li class="spanish"><?=html_helper::anchor('users/?language=spanish', html_helper::image('assets/images/system/flags/es.svg', array('title' => 'Spanish', 'data-tooltip' => 'default', 'data-position-my' => 'bottom center', 'data-position-at' => 'top center', 'width' => 22, 'height' => 22)))?></li>
										<? else: ?>
											<? foreach ( config::item('languages', 'core', 'keywords') as $langID => $val ): ?>
												<li class="<?=$val?>"><?=html_helper::anchor(uri::getURI() . '?language=' . $val, html_helper::image('assets/images/system/flags/' . config::item('languages', 'core', 'country_codes', $langID) . '.svg', array('title' => config::item('languages', 'core', 'names', $langID), 'data-tooltip' => 'default', 'data-position-my' => 'bottom center', 'data-position-at' => 'top center', 'width' => 22, 'height' => 22)))?></li>
											<? endforeach; ?>
										<? endif; ?>
									</ul>
								</div>
							<? endif; ?>
						</div>
					<? endif; ?>
				</div>
			</div>
		</div>
	</footer>

Enjoy,
Matrimo.com

Last edited by matrimo (2018-10-21 19:07:22)

Offline

#6 2018-11-16 14:52:22

dating4ababy
Member

Re: Language-flags on homepage in header (on top)

I cannot make it work. It shows a bullet list of flags on the left. I don't know how to modify it to eliminate the bullet point and make it appear in the top right corner, so that it's immediately visible. Where it is now by default (bottom right) it's almost useless.
Please make it modifiable from the control panel.
Thanks

Offline

#7 2018-11-16 15:36:19

matrimo
Member

Re: Language-flags on homepage in header (on top)

It will not work if you do not add the right css for that also. If you like it, you can inspire from matrimo.com or simply google it.

Last edited by matrimo (2018-11-16 19:55:34)

Offline

#8 2018-11-19 13:58:49

dating4ababy
Member

Re: Language-flags on homepage in header (on top)

I managed to do it and place flags on top right, for those interested:

After <div class="header"> add

<div class="languages">
<div align="right">
<ul>
<class="english"><a href="http://my.dating4ababy.com/how-to?language=english"><img data-tooltip="default" data-position-my="bottom right" data-position-at="top center" src="http://my.dating4ababy.com/assets/images/system/flags/gb.svg" alt="" data-hasqtip="1" oldtitle="English" title="" width="22" height="22"></a></li>
<class="spanish"><a href="http://my.dating4ababy.com/how-to?language=spanish"><img data-tooltip="default" data-position-my="top right" data-position-at="top right" src="http://my.dating4ababy.com/assets/images/system/flags/es.svg" alt="" data-hasqtip="2" oldtitle="Español" title="" width="22" height="22"></a></li>
<class="italiano"><a href="http://my.dating4ababy.com/how-to?language=italiano"><img data-tooltip="default" data-position-my="bottom center" data-position-at="top center" src="http://my.dating4ababy.com/assets/images/system/flags/it.svg" alt="" data-hasqtip="3" oldtitle="Italiano" title="" width="22" height="22"></a></li>
</ul>

Replace my website's address with yours. Hope it helps.

Offline

#9 2018-11-21 07:46:56

petka11
Member

Re: Language-flags on homepage in header (on top)

dating4ababy wrote:

I managed to do it and place flags on top right, for those interested:

After <div class="header"> add

<div class="languages">
<div align="right">
<ul>
<class="english"><a href="http://my.dating4ababy.com/how-to?language=english"><img data-tooltip="default" data-position-my="bottom right" data-position-at="top center" src="http://my.dating4ababy.com/assets/images/system/flags/gb.svg" alt="" data-hasqtip="1" oldtitle="English" title="" width="22" height="22"></a></li>
<class="spanish"><a href="http://my.dating4ababy.com/how-to?language=spanish"><img data-tooltip="default" data-position-my="top right" data-position-at="top right" src="http://my.dating4ababy.com/assets/images/system/flags/es.svg" alt="" data-hasqtip="2" oldtitle="Español" title="" width="22" height="22"></a></li>
<class="italiano"><a href="http://my.dating4ababy.com/how-to?language=italiano"><img data-tooltip="default" data-position-my="bottom center" data-position-at="top center" src="http://my.dating4ababy.com/assets/images/system/flags/it.svg" alt="" data-hasqtip="3" oldtitle="Italiano" title="" width="22" height="22"></a></li>
</ul>

Replace my website's address with yours. Hope it helps.

Thank you - with your help I have found more elegant solution:

after <div class="header"> add:

<? foreach ( config::item('languages', 'core', 'keywords') as $langID => $val ): ?>
	<?=html_helper::anchor(uri::getURI() . '?language=' . $val, html_helper::image('assets/images/system/flags/' . config::item('languages', 'core', 'country_codes', $langID) . '.svg', array('title' => config::item('languages', 'core', 'names', $langID), 'data-tooltip' => 'default', 'data-position-my' => 'bottom center', 'data-position-at' => 'top center', 'width' => 22, 'height' => 22)))?>
<? endforeach; ?>

without "<li>" - this html thingie makes lists inside "<ul>"
now the flags one after another in a row, above the logo and site name.
Also it automatically adds your own set of languages, and you can add more later if needed

Last edited by petka11 (2018-11-21 08:07:50)

Offline

#10 2019-04-25 04:56:00

markransome
Member

Re: Language-flags on homepage in header (on top)

I really like this and maybe Vlad might think about adding this in a future update with an option in admin for it i.e. - Flags at the top, bottom or both! smile

Mark

Offline

Board footer