Customizing SMF > Graphics and Templates

SMF Logo (2.1RC3) (I should know this.....)

(1/1)

Grammy:
I'm kicking the tires on 2.1RC3 on my test forum.  I wanted to remove the SMF logo, not replace it with a slogan or anything.  I made it go away, but there's a strange number 1 sitting on the page now, where the logo was.  (screenshot)  Something to do with an empty field?  It's a head scratcher for me, this early.   :)

I found this in index.template.php:


--- Code: --- echo '
', empty($settings['site_slogan']) ? '<img id="smflogo" src="' . $settings['images_url'] . '/smflogo.svg" alt="Simple Machines Forum" title="Simple Machines Forum">' : '<div id="siteslogan">' . $settings['site_slogan'] . '</div>', '';
--- End code ---

And replaced it with this:


--- Code: --- echo '
', empty($settings['site_slogan']) ?  : '<div id="siteslogan">' . $settings['site_slogan'] . '</div>', '';

--- End code ---

Doesn't throw any errors, no white page of death. Image disappears.

Also edited Index.css

First this:


--- Code: ---#siteslogan{
padding-right: 2px;
font-size: 1.4em;
}
--- End code ---

Then edited again to this (current edit) just trying to at least hide the number 1:


--- Code: ---#siteslogan{
     margin: 0;
padding: 0;
float: right;
line-height: 3em;
display: none;
}
--- End code ---

I also moved the svg image from the images directory.

I've emptied the cache, forced refresh.  But there it is, mocking me. 

Maybe it's still a botched edit, even though it removes the logo and doesn't give errors?



Kindred:
you have written the code incorrectly...
the way you rewrote it breaks the conditional....

try this


--- Code: --- echo '
', empty($settings['site_slogan']) ? '' : '<div id="siteslogan">' . $settings['site_slogan'] . '</div>', '';

--- End code ---

Grammy:

--- Quote from: Kindred on May 17, 2021, 10:51:12 AM ---you have written the code incorrectly...
the way you rewrote it breaks the conditional....

try this


--- Code: --- echo '
', empty($settings['site_slogan']) ? '' : '<div id="siteslogan">' . $settings['site_slogan'] . '</div>', '';

--- End code ---

--- End quote ---


I rushed back here when I saw "Kindred" cause I knew it was SORTED!   :D

Thanks so much, that's awesome!  Quotations actually mean something, ha!

Navigation

[0] Message Index

Go to full version