It looks like you're new here. If you want to get involved, click one of these buttons!
businessdad
MVP
Hi all,
I'm trying to add a Profile Tab in User's Profile Page, and, so far, I managed to do it with ProfileController->AddProfileTab() method. However, this adds my tab after all the other ones, when I'd like to have it as the first (and default) one. What's the easiest way to achieve this?
As usual, thanks in advance for the help. :)
Awards/Badges Plugin now available! | My blog - About Me - My Plugins for Vanilla
Answers
I found a working answer to my own questions, although it's not optimal. To decide in which orders to render the Tabs in User Profile, Vanilla uses a Sort Order (file tab.php).
This Sort Order can come from two places:
- User Preferences. Specifically, it's taken from
$this->User->Preferences. The curious thing is that I haven't found any reference to this parameter anywhere in the whole code of Vanilla, therefore I must assume that the feature doesn't exist yet (unless it's delegated to an Addon, of which I ignore the existence).- Application Preferences, i.e. from configuration setting
Garden.ProfileTabOrder. Not surprisingly, this setting is also not mentioned anywhere else in the code, therefore I make the same assumption as above.The solution Since there's no interface to change any of the above, I opted for the Application Configuration way. I added the following row in the configuration file:
$Configuration['Garden']['ProfileTabOrder'] = array('MyTab', 'Discussions', 'Thanks', 'Comments', 'Votes');Magically, the Tabs appear in the order I specify. Users can't change it as there isn't a way for them to do it, but I think I can live with it, at least for now. :)
Awards/Badges Plugin now available! | My blog - About Me - My Plugins for Vanilla
- Spam
- Abuse
- Troll
1 • Off Topic 1Insightful Awesome LOL •nice find and fix.
user->preferences - it may be used in these places user->preferences
factoid: Most questions have been previously answered, try the search box first, please provide your Vanilla version Number!
Peregrine's Addons - donations gladly accepted for "successful solutions" and addons - kind of like tipping a waiter at a restaurant
- Spam
- Abuse
- Troll
0 • Off Topic Insightful Awesome LOL •@peregrine Apologies for the confusion, when I stated "I haven't found any reference to this parameter anywhere", in relation to $User->Preferences, I meant that I couldn't find any place where this parameter is set. As you pointed out, it's used here and there, but Users, apparently, have no way to change it.
Of course, it could be done via code, but I don't think it's a good thing to allow Users to "code their own profile". ;)
Note: by the way, it would be nice if I could accept my own answer, since it's what I was looking for... I'll write a note on QnA plugin.
Awards/Badges Plugin now available! | My blog - About Me - My Plugins for Vanilla
- Spam
- Abuse
- Troll
0 • Off Topic Insightful Awesome LOL •this has been mentioned before - perhaps it will change.
meanwhile just @underdog flag your message and ask him to mark it solved :).
and tag it with Documentation
factoid: Most questions have been previously answered, try the search box first, please provide your Vanilla version Number!
Peregrine's Addons - donations gladly accepted for "successful solutions" and addons - kind of like tipping a waiter at a restaurant
- Spam
- Abuse
- Troll
0 • Off Topic Insightful Awesome LOL •