Adding images to menu tabs

Started by PurpleCrow, July 23, 2010, 03:50:02 PM

Previous topic - Next topic

PurpleCrow

I'd like to add a little "Home" button to the "Home" tab but I'm not sure how to do it, I've tried a few times but have just caused parse errors.

Anyone know how to do it?
SMF 2.0 RC3

Looking for staff!

Forums Galore, a brand new Admin Forum is looking for staff to help with the launch. Send me a PM or sign up to Forums Galore if you're interested!

Add your forum to the Forums Galore Community Showcase

cicka

Quote from: PurpleCrow on July 23, 2010, 03:50:02 PM
I'd like to add a little "Home" button to the "Home" tab but I'm not sure how to do it, I've tried a few times but have just caused parse errors.

Anyone know how to do it?

Do you want to replace the home button with an image? At the subs.php file find this code

'title' => $txt['home'],

And change it to this code

'title' => '<img src="' . $settings['images_url'] . '/imgname.gif" alt="" />',

Replace imgname.gif with your own image+extension and upload it in the images folder of your theme.

Mick.

To add an image next to the tabs name....... the oimage will show left to the text.

Lets use the "help" tab...

'title' => '<img src="URL OF IMAGE" alt="" /> ' .  $txt['help'],


Make sure your images are 12x12 pixels

cicka

Ah, I thought that he wanted to replace the buttons with images.

PurpleCrow

She :p

Na, wanted to add it next to it, thanks guys!!

I'll give it a go now :D
SMF 2.0 RC3

Looking for staff!

Forums Galore, a brand new Admin Forum is looking for staff to help with the launch. Send me a PM or sign up to Forums Galore if you're interested!

Add your forum to the Forums Galore Community Showcase

PurpleCrow

SMF 2.0 RC3

Looking for staff!

Forums Galore, a brand new Admin Forum is looking for staff to help with the launch. Send me a PM or sign up to Forums Galore if you're interested!

Add your forum to the Forums Galore Community Showcase

cicka

It should work. The code seems ok to me. Did you enter the right image name and path? What code did you use?

PurpleCrow

This is the code I used, but nothing appears (image is in correct place) -

'title' => '<img src="Themes/default/images/house.png" alt="" /> ' .  $txt['home'],
SMF 2.0 RC3

Looking for staff!

Forums Galore, a brand new Admin Forum is looking for staff to help with the launch. Send me a PM or sign up to Forums Galore if you're interested!

Add your forum to the Forums Galore Community Showcase

cicka

#8
Quote from: PurpleCrow on July 23, 2010, 05:10:19 PM
This is the code I used, but nothing appears (image is in correct place) -

'title' => '<img src="Themes/default/images/house.png" alt="" /> ' .  $txt['home'],

You have entered the image path wrong. Use this to define the path to your image

'title' => '<img src="' . $settings['images_url'] . '/house.png" alt="" /> ' .  $txt['home'],

PurpleCrow

Still not working... Ugh, nothings working tonight :(
SMF 2.0 RC3

Looking for staff!

Forums Galore, a brand new Admin Forum is looking for staff to help with the launch. Send me a PM or sign up to Forums Galore if you're interested!

Add your forum to the Forums Galore Community Showcase

cicka

#10
Quote from: PurpleCrow on July 23, 2010, 05:24:15 PM
Still not working... Ugh, nothings working tonight :(

Can you please upload here the Subs.php file?

Alternatively, can you define the direct url to the image?

'title' => '<img src="http://thewitchespath.com/Themes/overviewlight_20rc3/images/house.png" alt="" /> ' .  $txt['home'],

PurpleCrow

SMF 2.0 RC3

Looking for staff!

Forums Galore, a brand new Admin Forum is looking for staff to help with the launch. Send me a PM or sign up to Forums Galore if you're interested!

Add your forum to the Forums Galore Community Showcase

cicka


Mick.

@cicka

I used the direct image code as this didnt work me.  The image appeared missing.

'title' => '<img src="' . $settings['images_url'] . '/imgname.gif" alt="" />',

cicka

Quote from: bluedevil on July 23, 2010, 05:35:19 PM
@cicka

I used the direct image code as this didnt work me.  The image appeared missing.

'title' => '<img src="' . $settings['images_url'] . '/imgname.gif" alt="" />',


I had not tested it. I assumed that the standard img link would have worked. But the changes I made at the file should work :)

PurpleCrow

SMF 2.0 RC3

Looking for staff!

Forums Galore, a brand new Admin Forum is looking for staff to help with the launch. Send me a PM or sign up to Forums Galore if you're interested!

Add your forum to the Forums Galore Community Showcase

cicka

Quote from: PurpleCrow on July 23, 2010, 05:44:24 PM
Nope, still not appearing.

I tried it at my test site with the direct link to your image and it showed up.

PurpleCrow

Take a look at my forum - http://thewitchespath.com/index.php From what I can see its not there.
SMF 2.0 RC3

Looking for staff!

Forums Galore, a brand new Admin Forum is looking for staff to help with the launch. Send me a PM or sign up to Forums Galore if you're interested!

Add your forum to the Forums Galore Community Showcase

CapadY

Please, don't PM me for support unless invited.
If you don't understand this, you will be blacklisted.

PurpleCrow

SMF 2.0 RC3

Looking for staff!

Forums Galore, a brand new Admin Forum is looking for staff to help with the launch. Send me a PM or sign up to Forums Galore if you're interested!

Add your forum to the Forums Galore Community Showcase

Mick.

Go to your profile and switch to default theme and see if its there,

PurpleCrow

SMF 2.0 RC3

Looking for staff!

Forums Galore, a brand new Admin Forum is looking for staff to help with the launch. Send me a PM or sign up to Forums Galore if you're interested!

Add your forum to the Forums Galore Community Showcase

Mick.

This is from your subs.php file:

$buttons = array(
'home' => array(
'title' => '<img src="http://thewitchespath.com/Themes/overviewlight_20rc3/images/house.png" alt="" /> ' .  $txt['home'],
'href' => $modSettings['sp_portal_mode'] == 3 && empty($context['disable_sp']) ? $modSettings['sp_standalone_url'] : $scripturl,
'show' => true,
'sub_buttons' => array(
),
'is_last' => $context['right_to_left'],
// 'target' => '_blank',
),



It seems correct.  I can even see the image by its url:

http://thewitchespath.com/Themes/overviewlight_20rc3/images/house.png



Hmmm,...

PurpleCrow

I know! It doesnt make sense!

SMF seems to hate me at the moment :(
SMF 2.0 RC3

Looking for staff!

Forums Galore, a brand new Admin Forum is looking for staff to help with the launch. Send me a PM or sign up to Forums Galore if you're interested!

Add your forum to the Forums Galore Community Showcase

Antechinus

Quote from: bluedevil on July 23, 2010, 05:35:19 PM
@cicka

I used the direct image code as this didnt work me.  The image appeared missing.

'title' => '<img src="' . $settings['images_url'] . '/imgname.gif" alt="" />',

Check the globals. ;)
function setupMenuContext()
{
global $context, $modSettings, $user_info, $txt, $scripturl;

cicka

I am perplexed too why it is not showing up for you PurpleCrow because at my test forum it shows ok.

Mick.


PurpleCrow

Yup, I can see them and they look great, exactly what I want. I really dont understand why its not working...
SMF 2.0 RC3

Looking for staff!

Forums Galore, a brand new Admin Forum is looking for staff to help with the launch. Send me a PM or sign up to Forums Galore if you're interested!

Add your forum to the Forums Galore Community Showcase

Mick.

Quote from: PurpleCrow on July 24, 2010, 10:06:36 AM
Yup, I can see them and they look great, exactly what I want. I really dont understand why its not working...

Just for giggles.   Use 12x12 images. It may be that youre using 16x16 and is not fitting in there?   Not sure.



Use this one to test.

This is what ive been using:
'title' => '<img src="http://www.bluedevilcustoms.com/Themes/chocolat/images/admin/administration.gif" alt="" /> ' .  $txt['help'],

Mick.

You using OverviewLight theme right?  It should work too. Just tested it.

PurpleCrow

Tried it, didnt work.

There must be something preventing it from working, I'll leave it, doesnt matter. No point in you spending ages on it. Thanks for all your help though.
SMF 2.0 RC3

Looking for staff!

Forums Galore, a brand new Admin Forum is looking for staff to help with the launch. Send me a PM or sign up to Forums Galore if you're interested!

Add your forum to the Forums Galore Community Showcase

ɔɔɔɔɔɔuɥoɾ

I think adding the background image in the index.css file would work, since it already has a background image "menu_gfx.png"

Simply change the image to something you want, leave the title as it is, to get a background image and the title will remain also, on top of the image.


SMF 2.0 RC5

   
Webhost to New Webhost file transfer service, PM me - Fast transfers

PurpleCrow

I'm doing a clean install of my forum, just got the images to work ;D
SMF 2.0 RC3

Looking for staff!

Forums Galore, a brand new Admin Forum is looking for staff to help with the launch. Send me a PM or sign up to Forums Galore if you're interested!

Add your forum to the Forums Galore Community Showcase

PurpleCrow

Just found out that its a conflict with a modification, "Menu Order".
SMF 2.0 RC3

Looking for staff!

Forums Galore, a brand new Admin Forum is looking for staff to help with the launch. Send me a PM or sign up to Forums Galore if you're interested!

Add your forum to the Forums Galore Community Showcase

Mick.

Thats great PC.   Was it worth reinstalling the forum tho'?

PurpleCrow

I was planning on doing a clean install anyway, just so happened that it enabled me to find out what the issue was with these images at the same time :)
SMF 2.0 RC3

Looking for staff!

Forums Galore, a brand new Admin Forum is looking for staff to help with the launch. Send me a PM or sign up to Forums Galore if you're interested!

Add your forum to the Forums Galore Community Showcase

ɔɔɔɔɔɔuɥoɾ

So what was the solution afterall?
Just the Menu Order conflict?


SMF 2.0 RC5

   
Webhost to New Webhost file transfer service, PM me - Fast transfers

PurpleCrow

Yup, just the menu order conflict. I added the image on a clean forum and kept my eye out while I was installing mods, once the menu order mod had been installed the image dissappeared so I've uninstalled it and its back again :)
SMF 2.0 RC3

Looking for staff!

Forums Galore, a brand new Admin Forum is looking for staff to help with the launch. Send me a PM or sign up to Forums Galore if you're interested!

Add your forum to the Forums Galore Community Showcase

ɔɔɔɔɔɔuɥoɾ

So adding the image using the 'title' option in the button array was it then?


SMF 2.0 RC5

   
Webhost to New Webhost file transfer service, PM me - Fast transfers

PurpleCrow

Yup it was, I used the following code -

Quote from: bluedevil on July 23, 2010, 07:36:52 PM
This is from your subs.php file:

$buttons = array(
'home' => array(
'title' => '<img src="IMAGE URL" alt="" /> ' .  $txt['home'],

SMF 2.0 RC3

Looking for staff!

Forums Galore, a brand new Admin Forum is looking for staff to help with the launch. Send me a PM or sign up to Forums Galore if you're interested!

Add your forum to the Forums Galore Community Showcase

ɔɔɔɔɔɔuɥoɾ

On a hunch to get the Menu order and that working at the same time;

What changes to causes the image not to work after installing the Menu Order mod?


SMF 2.0 RC5

   
Webhost to New Webhost file transfer service, PM me - Fast transfers

PurpleCrow

I have no idea. I'll look into it later (got a lot of stuff to do from doing the clean install).
SMF 2.0 RC3

Looking for staff!

Forums Galore, a brand new Admin Forum is looking for staff to help with the launch. Send me a PM or sign up to Forums Galore if you're interested!

Add your forum to the Forums Galore Community Showcase

Antechinus

Glad you figured it out. Really that mod is unnecessary since changing the order of buttons is very easy once you know how. You could learn to do that in no time. :)

PurpleCrow

I know how to do it, its just laziness ;D
SMF 2.0 RC3

Looking for staff!

Forums Galore, a brand new Admin Forum is looking for staff to help with the launch. Send me a PM or sign up to Forums Galore if you're interested!

Add your forum to the Forums Galore Community Showcase

Kill Em All

PurpleCrow, is this solved?

I know I can be lazy too, alright, really lazy. haha


My Site: KEAGaming.com

Manual Installation of Mods
Prevent Spam and Forum Attacks
Please do not PM or email me for support unless offered, help should be publicly displayed to others.

Advertisement: