Advertisement:

Author Topic: Logo with link to (any) homepage  (Read 15661 times)

Offline GigaWatt

  • The Smiley Guy
  • Support Specialist
  • SMF Hero
  • *
  • Posts: 2,187
  • Gender: Male
    • Macedonian electronics forum
Re: Logo with link to (any) homepage
« Reply #20 on: June 08, 2018, 09:19:55 AM »
I edited the index.template.php file in the SMF Default Theme (2.0.14) right?  Not the Core Theme (2.0), right?

Yes, that's the one that should be edited ;).

no, that can't be right. you need an actual url in there

<a href="http:\\">', empty($context['header_logo_url_html_safe']) ? $context['forum_name'] : '<img src="' . $context['header_logo_url_html_safe'] . '" alt="' . $context['forum_name'] . '" />', '</a>

He's right, you need to have an actual URL in there, otherwise, it won't work. Have no idea how it works on your site with the "unfinished" URL.
"This is really a generic concept about human thinking - when faced with large tasks we're naturally inclined to try to break them down into a bunch of smaller tasks that together make up the whole."

"A 500 error loosely translates to the webserver saying, "WTF?"..."

Offline probeman

  • Semi-Newbie
  • *
  • Posts: 56
Re: Logo with link to (any) homepage
« Reply #21 on: June 08, 2018, 11:31:29 AM »
I edited the index.template.php file in the SMF Default Theme (2.0.14) right?  Not the Core Theme (2.0), right?

Yes, that's the one that should be edited ;).

Why the wink emoticon?   Are you saying I edited the wrong file?   I don't enjoy this being non-standard, I prefer to get it right.

Let me set it back to the original text and walk through the steps just confirm.  I went to Themes | Themes and Layout Settings  | Modify Themes menu, Then under Modify Themes | SMF Default Theme Curve (2.0.14) I clicked the "Browse the templates and files in this theme" link.

Then I clicked on index.template.php and edited these lines back to the original text"

Quote
function template_body_above()
{
   global $context, $settings, $options, $scripturl, $txt, $modSettings;

   echo !empty($settings['forum_width']) ? '
<div id="wrapper" style="width: ' . $settings['forum_width'] . '">' : '', '
   <div id="header"><div class="frame">
      <div id="top_section">
         <h1 class="forumtitle">
            <a href="', $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>';

   // the upshrink image, right-floated
   echo '

Then I clicked Save Changes and with this original text our forum logo link points to our forum as before.  So then I replaced the above red text to this text in red:

Quote
function template_body_above()
{
   global $context, $settings, $options, $scripturl, $txt, $modSettings;

   echo !empty($settings['forum_width']) ? '
<div id="wrapper" style="width: ' . $settings['forum_width'] . '">' : '', '
   <div id="header"><div class="frame">
      <div id="top_section">
         <h1 class="forumtitle">
            <a href="http://probesoftware.com">', empty($context['header_logo_url_html_safe']) ? $context['forum_name'] : '<img src="' . $context['header_logo_url_html_safe'] . '" alt="' . $context['forum_name'] . '" />', '</a>
         </h1>';

   // the upshrink image, right-floated
   echo '

Then clicked Save Changes.  Then when I put my mouse over our logo... wait a minute, that's weird.  It works now.

Hmmm, I'm pretty dyslexic so I have to wonder if it's because I had put http:\\probesoftware.com instead of http://probesoftware.com

Weird.  I'm really sorry for all the trouble.  It's working now with the full URL so I'm happy.  Thanks and sorry again.
« Last Edit: June 08, 2018, 12:07:25 PM by probeman »

Online Kindred

  • The Mean One
  • Support Specialist
  • SMF Legend
  • *
  • Posts: 58,569
  • Gender: Male
    • Kindred-999 on GitHub
Re: Logo with link to (any) homepage
« Reply #22 on: June 08, 2018, 01:13:51 PM »
glad its working.

incidentally.... although you CAN use the online/admin editor like that - best practice is to use your hosting file manager or FTP to edit php files
(and making bad edits directly could make your site inaccessible to correct the edit)

also, remember, with any updates, you may need to clear the cache after the change is applied...  both server side and browser side (ctrl-f5 on the page)
Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

Offline probeman

  • Semi-Newbie
  • *
  • Posts: 56
Re: Logo with link to (any) homepage
« Reply #23 on: June 08, 2018, 01:33:08 PM »
incidentally.... although you CAN use the online/admin editor like that - best practice is to use your hosting file manager or FTP to edit php files
(and making bad edits directly could make your site inaccessible to correct the edit)

I was wondering about that, but was also scared of ftp'ing the file back with the wrong file permissions...

Thanks for all your help.

Offline GigaWatt

  • The Smiley Guy
  • Support Specialist
  • SMF Hero
  • *
  • Posts: 2,187
  • Gender: Male
    • Macedonian electronics forum
Re: Logo with link to (any) homepage
« Reply #24 on: June 08, 2018, 05:43:03 PM »
Why the wink emoticon?   Are you saying I edited the wrong file?   I don't enjoy this being non-standard, I prefer to get it right.

It's a smiley... as far as I know ???... emoticons are symbols, smileys are formed using a combination of ASCII characters.

Beside the point... I used the wink smiley to say "you're right, that's the file that should be edited". I rarely use sarcasm in posts. If I wanted to be sarcastic, I would have written something like "Yeah, that's the one ::)".

Let me set it back to the original text and walk through the steps just confirm.  I went to Themes | Themes and Layout Settings  | Modify Themes menu, Then under Modify Themes | SMF Default Theme Curve (2.0.14) I clicked the "Browse the templates and files in this theme" link.

Correct ;). (Not being sarcastic.)

As for the rest of the post (not to quote the whole thing), yes, you did the right corrections ;). In your previous post, you wrote that you only added http://, not http://probesoftware.com... in which case it wouldn't have worked. I think that's what Kindred was trying to say, it can't work with an "unfinished" URL, you have to have the full URL in that field, the way you explained it in you next post ;) (again, not being sarcastic).
"This is really a generic concept about human thinking - when faced with large tasks we're naturally inclined to try to break them down into a bunch of smaller tasks that together make up the whole."

"A 500 error loosely translates to the webserver saying, "WTF?"..."

Offline brenth

  • Newbie
  • *
  • Posts: 2
Re: Logo with link to (any) homepage
« Reply #25 on: September 06, 2019, 08:45:04 AM »
I found this thread that described what I was trying to do with my new installation of SMF, however I seem to be having trouble making it work. I uploaded my logo image and that is displayed. I then found the header url line in the index template and edited it.

I changed this line

<a href="', $scripturl, '">', empty($context['header_logo_url_html_safe']) ? $context['forum_name'] : '<img src="' . $context['header_logo_url_html_safe'] . '" alt="' . $context['forum_name'] . '" />', '</a>

to this

<a href="mysiteurl">', empty($context['header_logo_url_html_safe']) ? $context['forum_name'] : '<img src="' . $context['header_logo_url_html_safe'] . '" alt="' . $context['forum_name'] . '" />', '</a>

But when I attempt to save it I get this error.

Template Parse Error!
There was a problem loading the /Themes/default/index.template.php template or language file. Please check the syntax and try again - remember, single quotes (') often have to be escaped with a slash (\). To see more specific error information from PHP, try accessing the file directly.

You may want to try to refresh this page or use the default theme.
syntax error, unexpected 'header_logo_url_html_safe' (T_STRING), expecting ',' or ';'

I have been careful not to change any other part of the template, so I do not know how to correct this error and was wondering if anyone might have a suggestion.

Offline Shambles

  • SMF Hero
  • ******
  • Posts: 5,191
  • Gender: Male
    • i30 Owners Club
Re: Logo with link to (any) homepage
« Reply #26 on: September 06, 2019, 09:05:02 AM »
Please download and attach that file to your next post and we'll have a look at it.

Online Kindred

  • The Mean One
  • Support Specialist
  • SMF Legend
  • *
  • Posts: 58,569
  • Gender: Male
    • Kindred-999 on GitHub
Re: Logo with link to (any) homepage
« Reply #27 on: September 06, 2019, 09:06:23 AM »
we need to see the ACTUAL line of text, with the actual url... I suspect that you changed something that should not have been changed....
Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

Offline brenth

  • Newbie
  • *
  • Posts: 2
Re: Logo with link to (any) homepage
« Reply #28 on: September 08, 2019, 01:26:18 PM »
The above is the actual line of text, and the actual URL was hxxp:arkansaschurchsecurity.org/ [nonactive]. I too thought I must have altered something though, as I mentioned I was careful not to change anything but what I indicated above.

In any case, after I could not get it to work I restored the original index.template file so that things would work again. Today I had the chance to go reinstate the change so I could upload the altered file here. However, this time it worked properly with no error. I am not able to determine what might have been different this time, but apparently there was some difference.

This is my first time to install and use the Simple Machines Forum and I appreciate your willingness to help me with my question.

 

Offline Arantor

  • Resident Overthinker
  • SMF Friend
  • SMF Legend
  • *
  • Posts: 71,847
    • StoryBB/StoryBB on GitHub
Re: Logo with link to (any) homepage
« Reply #29 on: September 08, 2019, 01:57:54 PM »
It would be helpful if you showed us the *exact* code you had, not 'here's what I did and here's the other part of it' because it sounds like when you edited it the first time, it wasn't edited correctly, and seeing exactly what you did matters for getting it right, though I guess it was right the second time.
Don’t try to tell me that some power can corrupt a person. You haven’t had enough to know what it’s like.

No good deed goes unpunished / No act of charity goes unresented.