QUICK NEWS

{NEW} - A new css video is up.

{OLD} - New video courtesy of Skhilled, Thanks for posting it up.

Video of the moment:


Internal Links

SMF Sites

Quick Info

Fixed Logo

Started by lesmond, Apr 28, 2019, 09:11 AM

Previous topic - Next topic

0 Members and 2 Guests are viewing this topic.

lesmond

I am trying to make it so the logo pre-loads when a theme is loaded, I have tried adding the code I found in smf2.0

this is the section I have added the logo image too 2.1RC2
<h1 class="forumtitle">
 <a id="top" href="', $scripturl, '">', empty($context['header_logo_url_html_safe']) ? $context['forum_name_html_safe'] : '<img src="' . $context['header_logo_url_html_safe'] . '" alt="' . $context['forum_name_html_safe'] . '">', '</a>
 </h1>';

this is what it looks like after...
<h1 class="forumtitle">
 <a id="top" href="', $scripturl, '">', empty($context['header_logo_url_html_safe']) ? '<img src="' . $settings['images_url'] . '/theme/logo1.png" alt="' . $context['forum_name_html_safe'] : '<img src="' . $context['header_logo_url_html_safe'] . '" alt="' . $context['forum_name_html_safe'] . '">', '</a>
 </h1>';

the logo loads but throws out the smflogo on the left

The only person who got all his work done by Friday was Robinson Crusoe

Bigguy

Does
forumtitle
have a float left in the css
"It's the American dream....cause ya have to be asleep to believe it." - George Carlin

Bigguy

You might have to play with the padding in that area.
"It's the American dream....cause ya have to be asleep to believe it." - George Carlin

lesmond

I think its this section that throws it out..
$settings['images_url']
I know I have done this before, but for the life of me I forgot (again :( )

The only person who got all his work done by Friday was Robinson Crusoe

Bigguy

Maybe removing one of the

<img src= would do the trick then...
"It's the American dream....cause ya have to be asleep to believe it." - George Carlin

SychO

I don't really understand what it is you're trying to do, why not just specify the logo's url in the theme's settings and then done ?

lurkalot

Quote from: SychO on Apr 28, 2019, 11:30 AMI don't really understand what it is you're trying to do, why not just specify the logo's url in the theme's settings and then done ?

I think Les is trying to create and package a theme with a default logo displayed. A default logo which can be then changed by the site admin by using the theme settings should that be desired..

I could be wrong though. ;)

lesmond

#7
Quote from: lurkalot on Apr 28, 2019, 11:46 AMI think Les is trying to create and package a theme with a default logo displayed. A default logo which can be then changed by the site admin by using the theme settings should that be desired..

Exactly right, thats what I want to do.

I have got a little closer, I managed to get the smflogo.svg to show now, but not the logo..

echo '
<div id="header">
<h1 class="forumtitle">
<a id="top" href="', $scripturl, '">',
empty($context['header_logo_url_html_safe']) ?
$context['forum_name_html_safe'] : '<img src="' .
$context['header_logo_url_html_safe'] . '/theme/logo.png" alt="' .
$context['forum_name_html_safe'] . '">', '</a>
</h1>';

The only person who got all his work done by Friday was Robinson Crusoe

SychO

<h1 class="forumtitle">
<a id="top" href="', $scripturl, '">', empty($context['header_logo_url_html_safe']) ? '<img src="' . $settings['images_url'] . '/theme/logo1.png" alt="' . $context['forum_name_html_safe'] . '">' : '<img src="' . $context['header_logo_url_html_safe'] . '" alt="' . $context['forum_name_html_safe'] . '">', '</a>
</h1>';

lesmond

Thanks @SychO

Strange, thats what I had in my first post, second code block, wonder why It didnt work first time?

Quote from: lesmond on Apr 28, 2019, 09:11 AMthis is what it looks like after...
<h1 class="forumtitle">
 <a id="top" href="', $scripturl, '">', empty($context['header_logo_url_html_safe']) ? '<img src="' . $settings['images_url'] . '/theme/logo1.png" alt="' . $context['forum_name_html_safe'] : '<img src="' . $context['header_logo_url_html_safe'] . '" alt="' . $context['forum_name_html_safe'] . '">', '</a>
 </h1>';

the logo loads but throws out the smflogo on the left

Ok so mark has solved  :rgton

The only person who got all his work done by Friday was Robinson Crusoe

SychO

This is the difference, php syntax, you didn't include what I highlighted in red

<h1 class="forumtitle">
 <a id="top" href="', $scripturl, '">', empty($context['header_logo_url_html_safe']) ? '<img src="' . $settings['images_url'] . '/theme/logo1.png" alt="' . $context['forum_name_html_safe'] : '<img src="' . $context['header_logo_url_html_safe'] . '" alt="' . $context['forum_name_html_safe'] . '">', '</a>
 </h1>';


<h1 class="forumtitle">
 <a id="top" href="', $scripturl, '">', empty($context['header_logo_url_html_safe']) ? '<img src="' . $settings['images_url'] . '/theme/logo1.png" alt="' . $context['forum_name_html_safe'] . '">' : '<img src="' . $context['header_logo_url_html_safe'] . '" alt="' . $context['forum_name_html_safe'] . '">', '</a>
 </h1>';

lesmond

Oh right :emb  cool :vcool thanks again mate :rgton

The only person who got all his work done by Friday was Robinson Crusoe