News:

Wondering if this will always be free?  See why free is better.

Main Menu

[RC3]Active tab on custom page

Started by zamg0d1, September 28, 2010, 11:02:30 AM

Previous topic - Next topic

zamg0d1

Hello,

I've made my own newsletter system (very basic) and I included the header of the forums using SSI but now it shows Home as active. But is it possible to make the Newsletter button as active? That would make it more nice to see where you really are.

And of course if it's possible to edit the navigation so it will show My Forums >> Newsletters of something? :)

I hope it's possible :D

IceXaos

Scroll near the bottom, and you'll see if (blah blah) current_action = 'this'

Create one by copying one of them, and setting the correct action name.

/e Should have stated, this is in ./Sources/Subs.php

zamg0d1

Well, the problem is I made a whole page by myself in another folder so I don't know if that solution will work? But I will look :D

IceXaos

Did you integrate it into the site using an action to locate the page?

zamg0d1

I just made the page and integrated stuff of SMF into my own page and added a link to my system, not integrated in SMF itself. So it's not action= but just in another folder...

Forums are:
http://mh.gaming-freak.nl/forum/

And my system is
http://mh.gaming-freak.nl/news/

IceXaos

I guess you could still do it, but it'll cause you to add something extra to the page to trigger off the action for tabs.  You're better off just adding an action and a page to the sources folder though.

/e There's a MOD for it if you don't wanna do it yourself.

zamg0d1

Ah you mean the Custom Page + Tab mod? But will it accept PHP? Because I use PHP in the system...

IceXaos

Probably, though I cannot answer for sure.  I create all of my extra pages manually.

IceXaos

Okay, I'll be nice and make a small tutorial for it.  Give me about 10-15 mins and I'll post back with a link.

zamg0d1

Ah thank you, really I'll appreciate it! I ow you this one.

Kays

#10
It's a two step process.

On your page you need to define $context['current_action'] so SMF knows which page you are viewing.


$context['current_action'] = 'newsletter';


Then in Subs.php that value needs to be set as $current_action

Find:


elseif ($context['current_action'] == 'groups' && $context['allow_moderation_center'])
$current_action = 'moderate';


and add after:


elseif ($context['current_action'] == 'newsletter';
$current_action = 'newsletter';


Note: the name of the button array in this case should be "newsletter" for it to work

If at first you don't succeed, use a bigger hammer. If that fails, read the manual.
My Mods

IceXaos

Here's how you can set it up inside the forum itself, and use your PHP.

http://www.simplemachines.org/community/index.php?topic=402675

Hopefully not flamed for sticking it there.  I couldn't post it where it belonged.

IceXaos

If you're good now, please tick this solved.

Advertisement: