HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.
How to set the default tab in the profile page
rloyola
New
Hi
Is there a way to set the default tab in the profile page (yoursite.com/profile) , right now activity is the default tab. I wish to do this in a plugin
Thanks
0
Comments
I need this because we have custom content added as part of the profile page and profile tab and I want to have that tab selected as default when the profile page shows up. I was able to accomplish this by overriding the ProfileController Index in a plugin but I had a feeling its not a good thing. Does anyone knows how to do it the right way?
The most intuitive approach would be a rewrite rule but that wouldn't work. Profile routes look like that:
So neither the first parameter after "/profile" nor the last parameter is always the username or the route. A rewrite rule therefore cannot be used 😐️
The next approach I had thought about would have been hooking into the dispatcher or the controllers initialize method, but that didn't look like the best approach either.
Therefore I think it is the best to do it that way:
Thanks