News:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu

How do I make the site logo a Link to my Web Site?

Started by tomsg, June 24, 2014, 09:29:31 AM

Previous topic - Next topic

tomsg

I'm wanting my forums to be with regards my web site. I've changed the site logo on SMF from the SMF logo to my site address.

Is it possible to have that address made a link to my web site so that members of the forums can simply click the address and be back to, or go to my site? If so, how do I pull the trick off?

Kindred

1- chit chat is not a good place to request support
2- smf version?
3- Depending on the theme, it may differ....   what theme? What is your URL?
4- it will probably require you to manually edit index.template.php
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

tomsg

Thanks for the reply.

I installed SMF 2.08 yesterday, so I've a lot to learn.

It's the default theme - Curve, and my site is still in the process of being built, so I'm up to my neck in it.

There must be a simple way to gain a link at the site logto area. I mean the forum site has links in that area, so it shouldn't be that tough. Or am I being a bit nieve. Yeh prob the later.

Matthew K.

You'll want to modify index.template.php. There is an anchor around the site logo variable that links to $scripturl, you can just change that to your site URL.

tomsg

Thanks for the response man. I'll give it a go once I've got my crash helmet properly on.

Kindred

Lab...    except for the fact that he was talking about a logo in place of the SMF logo...   which is not the standard site logo location
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

Matthew K.


Deaks

Assuming you mean the smf logo on the right you want to find this

<img id="smflogo" src="' . $settings['images_url'] . '/smflogo.png" alt="Simple Machines Forum" title="Simple Machines Forum" />
and add the link code to it so it becomes

<a href="http://www.exampleurl.com"><img id="smflogo" src="' . $settings['images_url'] . '/smflogo.png" alt="Simple Machines Forum" title="Simple Machines Forum" /></a>

The img code is nested in other data be careful not to change anything but the above code, alternativley find

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

and replace it with:

<a href="http://www.exampleurl.com"><img id="smflogo" src="' . $settings['images_url'] . '/smflogo.png" alt="Simple Machines Forum" title="Simple Machines Forum" /></a>

also change the url to be what you want it to be.
~~~~
Former SMF Project Manager
Former SMF Customizer

"For as lang as hunner o us is in life, in nae wey
will we thole the Soothron tae owergang us. In truth it isna for glory, or wealth, or
honours that we fecht, but for freedom alane, that nae honest cheil gies up but wi life
itsel."

tomsg


tomsg

Ehmmm.

Any chance telling me where I'll find the above code???

Please mind I'm a fragile newbie.

Deaks

~~~~
Former SMF Project Manager
Former SMF Customizer

"For as lang as hunner o us is in life, in nae wey
will we thole the Soothron tae owergang us. In truth it isna for glory, or wealth, or
honours that we fecht, but for freedom alane, that nae honest cheil gies up but wi life
itsel."


kat


tomsg

I tried the first option and nothing changed. Still had my site address but it wasn't a hyperlink.

The second option of replacing the code with what you suggest has indeed worked and takes me to my site. The problem is I'm back with the SMF logo.

The smflogo is mentioned in the code twice as is the name in quotes twice. I've considered experimenting and removing one and seeing what happens, but I'd rather leave it for a bit and hope for your response.

And yeh with regards backing up, oh too true. The article is excellent man and shall be followed.

Deaks

tomsg, how did you get rid of the logo in first plact, did you rename your logo and overwrite smf one or did you edit the name in the index.template.php?
~~~~
Former SMF Project Manager
Former SMF Customizer

"For as lang as hunner o us is in life, in nae wey
will we thole the Soothron tae owergang us. In truth it isna for glory, or wealth, or
honours that we fecht, but for freedom alane, that nae honest cheil gies up but wi life
itsel."

tomsg

Sorry, just finished a sleepover for my sins.

No nothing as complicated. At Admin - Configurations - Theme Settings I scrolled down to Theme Options and Preferences. In the Site Slogan box I placed my URL cause it advises that placing anything in the box will replace the SMF logo, and it worked perfect. But like I say, it just stated my site address, it wasn't a hyperlink to my URL.

I've now got a hyperlink to my site URL but I'm back with the SMF logo.

I've tried deleting the contents of the Site Slogan box and saving, then re-inputting the url and saving. Still got the SMF logo.

Hope you know what I'm doing wrong or what the hell to do right man.

Kindred

So, here's the deal...

Anything you put into the site slogan box is just that...   a site slogan. Text only. It will not parse as HTML.
It will replace the SMF logo with that text.  period.

If you want to add your own logo and make it hyperlinked, you will need to edit index.template.php to use your image filename and add a link to it in the code.
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

tomsg

Yeh I know that.

Thanks to Μπράιαν I've succeeded with the code stuff and got the hyperlink to my site.

What I don't get is the changes as advised by Μπράιαν have somehow caused the text in the site slogan stay as the site slogan even when I type in the text of my url.

Logic tells me that my typing in the text will replace the slogan with my text as it clearly states that's what it would do; but it don't.

I'm trying to work how why and how I can now get the text of my url in the place of the slogan then I shall have both the text of my url and the hyperlink in place.

Hope you followed all that

Kindred

the only way to do it is to ignore the site slogan setting and do it directly in the code....
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

Burke ♞ Knight

Quote from: Kindred on June 26, 2014, 12:47:45 PM
So, here's the deal...

Anything you put into the site slogan box is just that...   a site slogan. Text only. It will not parse as HTML.
It will replace the SMF logo with that text.  period.

If you want to add your own logo and make it hyperlinked, you will need to edit index.template.php to use your image filename and add a link to it in the code.

In that box, the OP can use HTML, to make the link, no file edits needed:

Code (Insert This) Select
<a href="YOUR SITE URL">YOUR TEXT FOR IT</a>

Advertisement: