Simple Machines Community Forum

Customizing SMF => Graphics and Templates => Topic started by: Big Gee on December 14, 2017, 07:39:06 PM

Title: Inserting a hyperlink to main site in right hand header logo
Post by: Big Gee on December 14, 2017, 07:39:06 PM
Hi All,

I'm using SMF v 2.0.15

I've changed the default Simple Machines header logo to my own. I would now like to insert a link back to the home page of the main site by inserting it in the logo.

Can you please tell me what file I need to edit? I've checked out the index.template.php file but can't find what I'm looking for. Is this the correct file? If not which one is it?

Can you also tell me what I need to edit? I would also like to replace the 'screen tip' when hovering over the logo instead of having it display "Simple Machines Forum" to my own text.

Many thanks,

G.
Title: Re: Inserting a hyperlink to main site in right hand header logo
Post by: skb on December 14, 2017, 09:24:58 PM
It is the correct file. You can do a search for "forumtitle" then insert the <a href> to your site below that.

<h1 class="forumtitle">
<a href="http://www.yoursite.com/" target="_blank"', $scripturl, '">', empty($context['header_logo_url_html_safe']) ? $context['forum_name'] : '<img src="' . $context['header_logo_url_html_safe'] . '" alt="' . $context['forum_name'] . '" />', '</a>
</h1>';


target="_blank" will be required only if you wish to open the site in a new tab.
Title: Re: Inserting a hyperlink to main site in right hand header logo
Post by: Big Gee on December 15, 2017, 06:02:52 AM
Ah! Thanks skb. BUT that edit places the link in the LEFT hand side of the header (forum name). What I want to do is place the link in the RIGHT hand logo graphic.

Where do I edit that bit of coding? I presume it's in the same file, but where in the file? Also what do I insert?

Thanks,

G.
Title: Re: Inserting a hyperlink to main site in right hand header logo
Post by: Sir Osis of Liver on December 15, 2017, 11:50:45 AM


', empty($settings['site_slogan']) ? '<img id="smflogo" src="' . $settings['images_url'] . '/smflogo.png" alt="Simple Machines Forum" title="Simple Machines Forum" />' : '<div id="siteslogan" class="floatright">' . $settings['site_slogan'] . '</div>', '


Title: Re: Inserting a hyperlink to main site in right hand header logo
Post by: Big Gee on December 15, 2017, 12:25:16 PM
Great - the silent strong type I see!

WHERE does the url address go & does that coding go in the index.template.php file?

You're not dealing with an expert in PHP coding here - so a little bit more information wouldn't go amiss.

G.
Title: Re: Inserting a hyperlink to main site in right hand header logo
Post by: Sir Osis of Liver on December 15, 2017, 12:37:16 PM
Just wrap the logo in <a></a> tags -

index.template.php



', empty($settings['site_slogan']) ? '<a href="http://www.yoursite.com"><img id="smflogo" src="' . $settings['images_url'] . '/smflogo.png" alt="Simple Machines Forum" title="Simple Machines Forum" /></a>' : '<div id="siteslogan" class="floatright">' . $settings['site_slogan'] . '</div>', '


Title: Re: Inserting a hyperlink to main site in right hand header logo
Post by: Big Gee on December 15, 2017, 12:43:43 PM
Thank you Sir Osis of Liver - that's worked a treat.

All the best,

Gwilym