Hi.
I know the old index.template.php editing process, but with the new updates, I no longer understand how to add a custom button to the navigation menu/strip.
Could anyone assist?
Thanks!!
The buttons in SMF2.0 are now inside an array, which you will find in Sources/Subs.php. Search for "menu_buttons".
Sweet. Thanks.
Now, where can I define "actions"? When I visit the "Chat" page, it believes the current action is Home. This is because I am linking to a ?page file instead of an ?action file. How can I go about fixing this?
I can either:
1) Define the "action" for Home. And make "Chat" the default.
2) Define the "action for "Chat".
Thanks.
What about this?
http://www.simplemachines.org/community/index.php?topic=261880.0
Quote from: robbie93 on April 25, 2010, 08:38:00 PM
What about this?
http://www.simplemachines.org/community/index.php?topic=261880.0
Thanks :) I should've searched there the first time around, but Bloc already answered that for me :P
I just need to figure out how to make my new button an "action".
easy way , copy + paste [Home] tab and then add your [name] + URL
Quote from: Crip on April 25, 2010, 09:05:21 PM
easy way , copy + paste [Home] tab and then add your [name] + URL
Problem: my URL is a 'page' not an 'action'. So TinyPortal does not register it as the 'current_action', so when I access my new "Chat" page, it highlights the "Home" button as the 'current_action'.
To fix this, I must make '?action=chat' defined. How can I do this?
Thanks!
direct URL==> echo '<a href="http://www.yoursite.com" title="" '?action=chat">Chat</a>';
Quote from: Crip on April 25, 2010, 09:44:07 PM
direct URL==> echo '<a href="http://www.yoursite.com" title="" '?action=chat">Chat</a>';
My problem is that the "action" 'chat' is not defined. Putting that in my URL just brings me to the forums.
How do I make '?action=chat' go to the "chat page".
Thanks! :)
can U show a link to theme + [chat] ?
...you can PM link if you wanna.
www.dbgc.tk/forums
If you click "Chat", it thinks you're visiting "Home". I'd like to fix that :)
cralor what chat are you using? it would be easy to show us the url of the chat itself
http://dbgc.tk/forums/index.php?page=2
There is the direct link, although the problem has nothing to do with the actual chat software.
You add it the same way you would in SMF1, only in Subs.php. There is a section right beneath the buttons that shows you how to set actions. You'll need to add some custom code to make your button highlight.
if (isset($_GET['page']) && $_GET['page'] == 2)
$current_action = 'chat';
Try ::
'chat' => array(
'title' => $txt['chat'],
'href' => $scripturl . '?page=2',
'show' => true,
'sub_buttons' => array(
),
),
Or :
'chat' => array(
'title' => $txt['chat'],
'href' => $scripturl . 'http://dbgc.tk/forums/index.php?page=2',
'show' => true,
'sub_buttons' => array(
),
),
? ? ÷
Hi B0ss :P :D
Quote from: IchBinâ„¢ on April 25, 2010, 11:29:06 PM
You add it the same way you would in SMF1, only in Subs.php. There is a section right beneath the buttons that shows you how to set actions. You'll need to add some custom code to make your button highlight.
if (isset($_GET['page']) && $_GET['page'] == 2)
$current_action = 'chat';
That's what I was looking for :) Thanks!
Sorry Crip... I guess I wasn't that descriptive :) Thanks for your help though!!
yep ,
B0ss .. = 'codemonkey' :P
hehe, getting there slowly Crip. :) It's hard to articulate what one needs some times. Sooner or later one of us will get it. :D
Quote from: Crip on April 25, 2010, 09:05:21 PM
easy way , copy + paste [Home] tab and then add your [name] + URL
Easiest way I've found is to use these two mods,
Custom site menu (http://custom.simplemachines.org/mods/index.php?mod=2259) Compatible With: 2.0 RC1.2, 2.0 RC2. You'll need to install it in emulate mode. Runs fine on my RC3 install.
And this one to adjust the order of your menu buttons, Menu order (http://custom.simplemachines.org/mods/index.php?mod=2348) Compatible With: 2.0 RC2, 2.0 RC3
Couldn't be much easier than this. ;)
Thanks to ozzie for pointing these out to me. ;) http://www.smfarcade.info/forum/index.php?topic=6941.0