Login Link mit einem Icon aufrufen

Please post the URLs to pages, where you've made a CMSimple template available for download

Moderator: mikey

Post Reply
Vic
Posts: 34
Joined: Tue Jan 27, 2015 3:43 pm

Login Link mit einem Icon aufrufen

Post by Vic » Sat Sep 10, 2016 9:02 pm

Hallo Zusammen

Ich möchte in meinem Template den "Login"-Link nicht mit einem Textmenu, sondern mit einer PNG-Grafik/Icon aufrufen, die sich im Template-Unterordner 'images' befindet... kann mir jemand mit dem Code aushelfen?

Im Forum habe ich folgenden Thread gefunden, dieser bezieht sich allerdings auf die Print-Funktion und ist schon 3 Jahre alt; vielleicht gibt es für meine Version 1.6.5 und neuere etwas anderes?

http://cmsimpleforum.com/viewtopic.php? ... con#p37529

Besten Dank für die Hilfe.

Grüsse, Vic

Tata
Posts: 3586
Joined: Tue May 20, 2008 5:34 am
Location: Slovakia
Contact:

Re: Login Link mit einem Icon aufrufen

Post by Tata » Sun Sep 11, 2016 5:55 am

Follow exactly the mentioned post.
The loginlink design is more a topic of template, so I would logically prefere to have the login icon savede in template/images directory.
Teh simply replace

Code: Select all

<?php echo loginlink();?>
by

Code: Select all

<a href="./?&login"><?php echo tag('img src="'.$pth['folder']['templateimages'].'login.png" alt="' . $tx['menu']['login'] . '"');?></a>
or extend it to

Code: Select all

<a href="./?&login" title="<?php echo $tx['menu']['login'];?>"><?php echo tag('img src="'.$pth['folder']['templateimages'].'login.png" alt="' . $tx['menu']['loggin'] . '"');?></a>
CMSimple.sk
It's no shame to ask for an answer if all efforts failed.
But it's awful to ask without any effort to find the answer yourself.

Vic
Posts: 34
Joined: Tue Jan 27, 2015 3:43 pm

Re: Login Link mit einem Icon aufrufen

Post by Vic » Sun Sep 11, 2016 7:04 am

Dear Tata

Thx for your quick answer! As I am not really a coder, I have still two questions:

1.) What is the difference beetween both Versions, or else, what does the 'extended' Version do more than the first one?
2.) The last 'loggin' of the extended Version should rather read 'login', am I correct?

Thx for your reply, Vic

Tata
Posts: 3586
Joined: Tue May 20, 2008 5:34 am
Location: Slovakia
Contact:

Re: Login Link mit einem Icon aufrufen

Post by Tata » Sun Sep 11, 2016 1:25 pm

Vic wrote:1.) What is the difference beetween both Versions, or else, what does the 'extended' Version do more than the first one?
The only difference is a hover-tooltip generated by

Code: Select all

title="<?php echo $tx['menu']['login'];?>"
Vic wrote:2.) The last 'loggin' of the extended Version should rather read 'login', am I correct?
Yes, it was my tipo. "login" is correct of course.

You may replace other template functions this way.
E.g.:

Code: Select all

<a class="button" title="sitemap" href="./?&sitemap"><img src="<?php echo $pth['folder']['templateimages'];?>button_sitemap.png" alt="sitemap"></a>
<a class="button" title="mailform" href="./?&mailform"><img src="<?php echo $pth['folder']['templateimages'];?>button_email.png" alt="mailform"></a>
or any link

Code: Select all

<a class="button" title="guestbook" href="your_guestbook_page"><img src="<?php echo $pth['folder']['templateimages'];?>button_guestbook.png" alt="guestbook"></a>
<a class="button" title="Join us on facebook" href="your_facebook_URL"><img src="<?php echo $pth['folder']['templateimages'];?>button_facebook.png" alt="facebook"></a>
<a class="button" title="Join us on twitter" href="your_twitter_URL"><img src="<?php echo $pth['folder']['templateimages'];?>button_twitter.png" alt="twitter"></a>
<a class="button" title="Join us on google+" href="your_google_URL"><img src="<?php echo $pth['folder']['templateimages'];?>button_google_plus.png" alt="google+"></a>
CMSimple.sk
It's no shame to ask for an answer if all efforts failed.
But it's awful to ask without any effort to find the answer yourself.

Vic
Posts: 34
Joined: Tue Jan 27, 2015 3:43 pm

Re: Login Link mit einem Icon aufrufen

Post by Vic » Sun Sep 11, 2016 8:51 pm

Perfect, thank you!

Post Reply