MyBB Community Forums

Full Version: Make logo visible on index page only?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
I want my logo to only display on the index page of my forum, is there any way to do this?
remove logo code from the header template and place it in index template !
Thanks!

(2013-04-01, 03:24 PM).m. Wrote: [ -> ]remove logo code from the header template and place it in index template !

What if I wanted to use a different (smaller image) for the rest of the forum besides the index page. I just tried editing the code in the header template and it changed my logo also on index.

Im obviously not a coder!
You want 2 logos to display, one for the index only and the other is for all the other locations, right? Well you can do it using jQuery.

First add the jQuery library to your site using well-known way.

Upload 2 logo images to your image folder. Set the default logo as the one you want to display to all the locations other than index (the smaller one) from the board logo option of your theme property:

[Image: MalHurs.png]

Make sure the path you are specifying is correct.

Now, open your 'header' template and find:

<img src="{$theme['logo']}" alt="{$mybb->settings['bbname']}" />

Make it:

<img id="logoimg" src="{$theme['logo']}" alt="{$mybb->settings['bbname']}" />

Now add at the very end of the same template:

<script type="text/javascript">
jQuery.noConflict();
if ( document.location.href.indexOf('index') > -1 ) {
	jQuery("#logoimg").attr("src","images/biglogo.png");};
</script>

Save the template. Now biglogo.png will be the logo image of yout index page and smalllogo.png will be for any other location.
Thank you so much! Very fast reply! I appreciate it. Smile
That worked! Any way to fix the issue of the smaller logo showing on the index after clearing cache or being a first time visitor? It shows small on index until you click the logo or use a breadcrumb.
you could simply use these plugins if you want different logo for the site pages
http://mods.mybb.com/view/dynamic-forum-logo
http://mods.mybb.com/view/ougc-forum-logo

You could choose according to your likes,
regards
Nice, I will give this a go! Thanks

I just noticed its because my portal page, not index.php. Is there any way to display the larger logo file on the portal template?
If you are using my method then change the bold text in script:

if ( document.location.href.indexOf('portal') > -1 ) {

You can try placing the script in your footer template to solve the issue you have faced with that.
I tried it and its a no go. I should have been more clear last night, sorry. (beer) I would like my larger logo to display on the portal page and the index page only, the rest of the board will display the smaller logo.

i replaced the index with (portal) and the portal still shows small. I also placed in the footer temp.

Thanks for being patient im learning a lot as I go!
Pages: 1 2