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

Advertisement: