Please upgrade here. These earlier versions are no longer being updated and have security issues.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.
Removing left sidepanel on profile (themehooks)
DansTooGood
New
Hey,
When designing my site, I noticed that the guest sidebar which was meant to only appear on the forums, appears on my profile pages too.
Here is an image of what the profile looks like when logged out:
Here is an image of what the profile looks like when logged in (what they should look like whether logged in or not):
I want to remove the guest module from all pages (especially profiles) except the forums, the forums look like this now (which is how they are meant to look):
How would I go about doing this?
Any help is greatly appreciated,
Thanks,
DansTooGood.
Tagged:
0
Comments
do you have a themehooks file?
grep is your friend.
My bad, wrong answer
There was an error rendering this rich post.
That wasn't question he was asking.
grep is your friend.
Maybe, just maybe the solution is something similar to this:
I need something similar myself, but haven't tried it. Let's give it a couple of guesses:
If the Controller is 'Profile', you want to hide the 'Panel' asset and in "all other cases" you do not want to hide the 'Panel' asset. Does that help a bit? Now you need to figure out how to test if the Controller is 'Profile'. Use Smarty
{debug}
.There was an error rendering this rich post.
no it is nothing to do with that. ATM the guest module is added to panel, he want to remove it. However the guest module shouldn't be added to a profile page anyway (unless he is talking about some custom page)
We need your version, what theme it is based on and what other addons are installed.
For all we know this is a completely different software
it is possible that the theme has added module the naive smarty way, but this is not how I would recommend adding modules to panel.
grep is your friend.
I'm using "CustomPages" for the page system on my forums, I am also using Vanilla Bootstrap for the theme.
If I need to provide anything else, please tell me what I need and maybe give me a few pointers on how to retrieve it, thanks for the help so far guys!
The guest module shows up by default for logged out users in the profile controller and the default view. You can hide it with CSS rules targeting specific body classes. You can also unset the guest module through a hook, but we need to know what version of Vanilla you're using if the CSS method doesn't do the job. Also, when you say you want it to show up only on the forums, do you mean the discussion indexes and also on the page for the individual discussion?
Additionally, your last screenshot brings forth confusion in that it shows that you are logged in and you said that's how it's meant to look while the problem is about the guest module, which doesn't show up while you're logged in.
Add Pages to Vanilla with the Basic Pages app
Assume 2.1 or higher, because the Bootstrap theme requires 2.1 at least.
There was an error rendering this rich post.
Yes that explains it the PluignController which is used for the page, therefore it inherits the standard menus. If you simply wan the remove the panel you can use
before
in the custom pages default.php
If you want your custom pages to inherit the profile panel and you only want these pages to be profile pages you could change in the custom pages default.php
to
note you need to remove all
&
from every(&$Sender)
as this is not needed in modern version of PHP and was included naively.You would need to then change all reference to
plugin/page
and make itprofile/page
then you need to change your reference links to point to the right url.
I would completely rename the pluign since you are making a fork. You can change the plugin folder name change
$PluginInfo['CustomPages']
to match the folder name, and change the$PluginInfo
to suit, also change the class nameCustomPagesPlugin
.If you want a link to be in the profile tabs you can add in default.php
before
then add
just after
if you page is named like this
some-page.php
the tab label will be 'Some Page'grep is your friend.
Okay thanks, I'll try this after I've got my fight back home.
I'll get back to you, thanks.
I've managed to edit it so it's this:
The bar still does not disappear, have I done this incorrectly?
Note, the profile is a modified version of the original Vanilla profile page and is not made in CustomPages.
I think this is where you have gone wrong. How have you modified this page? I presume you are talking about a view?
grep is your friend.
Yes, I think I modified it in the view, I believe the directory contained view.
first if you are going to modify core views, copy them over to your theme's view folder that way they won't get overwritten when you update.
Secondly you would have to use themehooks to remove the panel. If you are creating a completely new page, you might as well approach it that way.
grep is your friend.
Note to self : tag = theme-hooks and the file to alter is class.[themenameinlowercase]themehooks.php The classname for the themehooks class is _themenameinCamelCase_Themehooks If you look in about.php you can see the theme name to use : $ThemeInfo['ThemeName']. It will hide the asset, but the HTML surrounding the asset will not be hidden. I need the extra '3 columns' so I cannot manipulate with CSS.
Sorry for breaking into the thread.
There was an error rendering this rich post.
I removed some "AddSideMenu" PHP thing which seemed to fix it, thank for the help guys.
How? If you removed it from the core your doing it wrong. Unless of course you are making a fork, then you maintain that, and are responsible for supporting it.
grep is your friend.