Simple Machines Community Forum

Customizing SMF => Graphics and Templates => Topic started by: Grammy on May 17, 2021, 10:46:23 AM

Title: SMF Logo (2.1RC3) (I should know this.....)
Post by: Grammy on May 17, 2021, 10:46:23 AM
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:

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


And replaced it with this:

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


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

Also edited Index.css

First this:

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


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

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


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?



Title: Re: SMF Logo (2.1RC3) (I should know this.....)
Post by: 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


echo '
', empty($settings['site_slogan']) ? '' : '<div id="siteslogan">' . $settings['site_slogan'] . '</div>', '';
Title: Re: SMF Logo (2.1RC3) (I should know this.....)
Post by: Grammy on May 17, 2021, 10:54:02 AM
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


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



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!