Inserting a hyperlink to main site in right hand header logo

Started by Big Gee, December 14, 2017, 07:39:06 PM

Previous topic - Next topic

Big Gee

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.

skb

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.

SMF 2.1.4 / TP 2.2.2

Big Gee

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.

Sir Osis of Liver



', 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>', '


Ashes and diamonds, foe and friend,
 we were all equal in the end.

                                     - R. Waters

Big Gee

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.

Sir Osis of Liver

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>', '


Ashes and diamonds, foe and friend,
 we were all equal in the end.

                                     - R. Waters

Big Gee

Thank you Sir Osis of Liver - that's worked a treat.

All the best,

Gwilym

Advertisement: