Advertisement:

Author Topic: Inserting a hyperlink to main site in right hand header logo  (Read 322 times)

Offline Big Gee

  • Semi-Newbie
  • *
  • Posts: 23
Inserting a hyperlink to main site in right hand header logo
« 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.

Offline skb

  • Charter Member
  • Jr. Member
  • *
  • Posts: 223
    • Metabolically Challenged
Re: Inserting a hyperlink to main site in right hand header logo
« Reply #1 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.

Code: [Select]
<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.
« Last Edit: December 14, 2017, 09:40:03 PM by skb »
Learning, every day.
Forum - The Diabetic Pub
Because every diabetic needs help
SMF 2.0.15 (default theme) / TP 1.2R3

Offline Big Gee

  • Semi-Newbie
  • *
  • Posts: 23
Re: Inserting a hyperlink to main site in right hand header logo
« Reply #2 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.

Offline Sir Osis of Liver

  • SMF Hero
  • ******
  • Posts: 7,309
  • There's someone in my head but it's not me.
Re: Inserting a hyperlink to main site in right hand header logo
« Reply #3 on: December 15, 2017, 11:50:45 AM »
Code: [Select]

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


Offline Big Gee

  • Semi-Newbie
  • *
  • Posts: 23
Re: Inserting a hyperlink to main site in right hand header logo
« Reply #4 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.

Offline Sir Osis of Liver

  • SMF Hero
  • ******
  • Posts: 7,309
  • There's someone in my head but it's not me.
Re: Inserting a hyperlink to main site in right hand header logo
« Reply #5 on: December 15, 2017, 12:37:16 PM »
Just wrap the logo in <a></a> tags -

index.template.php

Code: [Select]

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


Offline Big Gee

  • Semi-Newbie
  • *
  • Posts: 23
Re: Inserting a hyperlink to main site in right hand header logo
« Reply #6 on: December 15, 2017, 12:43:43 PM »
Thank you Sir Osis of Liver - that's worked a treat.

All the best,

Gwilym