News:

Want to get involved in developing SMF, then why not lend a hand on our github!

Main Menu

How do you add / edit menu buttons

Started by jamiesage123, May 28, 2011, 11:36:09 AM

Previous topic - Next topic

jamiesage123

Hi,

I would like to know how to add / edit menu buttons on the "Fresh" theme. I've looked at the "How do you add custom tabs to the Core (default) theme menu?" and some other tutorials; unfortunately they didn't help.

I can't find this in the "Fresh" theme:


All Colours Sam

Hi jamiesage123 what version of SMF are you using?   depending on the version is the way to add new buttons to your menu.

by your message I suspect your using 1.1.x, if so, feel free to attach your theme's index,template.php file and I can assist you.
Oh, wouldn't it be great if I *was* crazy? ...then the world would be okay
Suki

jamiesage123

I'm using SMF 2.0 RC5 if that is what you mean.

I've attached the index.template.php

All Colours Sam

oh!   then you must follow this tutorial:  Adding tabs to SMF 2.0


on 2.0 you add buttons on your Sources/Subs.php   and it will automatically appear on every theme you use.
Oh, wouldn't it be great if I *was* crazy? ...then the world would be okay
Suki

jamiesage123

Gah, that doesn't work for me either.

I added a "Test" button; but it still doesn't show:
(The Home button is in the correct position, but it didn't align correctly on here)


                                'home' => array(
'title' => $txt['home'],
'href' => $scripturl,
'show' => true,
'sub_buttons' => array(
),
'is_last' => $context['right_to_left'],
),
'help' => array(
'title' => $txt['help'],
'href' => $scripturl . '?action=help',
'show' => true,
'sub_buttons' => array(
),
),
'test' => array(
'title' => $txt['test'],
'href' => $scripturl,
'show' => true,
'sub_buttons' => array(
),
),
'search' => array(
'title' => $txt['search'],
'href' => $scripturl . '?action=search',
'show' => $context['allow_search'],
'sub_buttons' => array(
),
),

All Colours Sam

you must add this $txt['test']   to your   Themes/default/lanfuages/index.language.php  file

at the end before the ?>


$txt['test'] = 'Test button'; 

and clean your cache in admin / maintenance / forum maintenance / cache
Oh, wouldn't it be great if I *was* crazy? ...then the world would be okay
Suki

jamiesage123

I cant find the index.language.php file.


All Colours Sam

its on your default   folder and not the theme you are using:

/Themes/default/languages/index.language.php   where  language is the language you are currently using,  example  index.english.php
Oh, wouldn't it be great if I *was* crazy? ...then the world would be okay
Suki

jamiesage123

I've added $txt['test'] = 'Test button';  to index.english.php, and ran "Empty the file cache". Still nothing. :E

All Colours Sam

can I have a link to your forum?


are you sure you are using english as your language and not english-utf8 or other language?


can you attach your /Themes/default/languages/index.english.php here.
Oh, wouldn't it be great if I *was* crazy? ...then the world would be okay
Suki

jamiesage123


All Colours Sam

I searched your file and couldn't find any  $txt['test']   on it, make sure you add this to your index.english.php file:


$txt['test']  = 'Test':   


at the bottom before  the ?>
Oh, wouldn't it be great if I *was* crazy? ...then the world would be okay
Suki

jamiesage123

I had two of the same folders, in different locations. I was using the wrong one O:)

It worked, thank you so much!

Advertisement: