Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Request to make NavbarHorizontal permission a LocalSettings configuration #388

Open
revansx opened this issue Jul 16, 2023 · 4 comments
Open

Comments

@revansx
Copy link

revansx commented Jul 16, 2023

I use the Clean.xml (chameleon v4.2.1) as the default skin on a private wiki, however, because of [1] unregistered users who aren't yet logged-in don't get to see the horizontal Navbar at the top and - as a result - are not shown the Special:Login link in the top-right .. it only shows for registered users.

I have been able to obtain the desired behavior by deleting line 29 in layouts/cean.xml [1].

<modification type="ShowOnlyFor" permission="edit"/>

Would it be possible to add a new configuration variable in LocalSettings like:

$egChameleonAlwaysShowNavbar = 'true';

that would wrap that line in an if-then statement making this behavior a configurable option?

Thanks!
/Rich

[1] https://github.com/ProfessionalWiki/chameleon/blob/d2da6b498eca0f75f188103a4a1e67416e8e250f/layouts/clean.xml#L29C52-L29C55

@malberts
Copy link
Contributor

It's not possible to use LocalSettings config in the layout XML file. Within a component's PHP you can access that, but that would be a very roundabout way to override a component when the simplest solution is to not have the component in the first place.

Have you considered using a custom layout file based on Clean.xml but without that line? (i.e. instead of modifying the layout in the skin directory). I suppose the documentation isn't very clear about how to do this:
https://github.com/ProfessionalWiki/chameleon/blob/master/docs/customization.md#layout-of-page-elements
Basically, copy Clean.xml outside the skin directory and reference that instead:

$egChameleonLayoutFile= __DIR__ . '/somewhere/else/Clean.xml';

(Path relative to LocalSettings)

@revansx
Copy link
Author

revansx commented Jul 20, 2023

My project doesn't allow me to develop custom code on the server that must be maintained separately from the components we use from git. So I can only use whatever configure options a components offers.

That said, what is the point of denying the navbar to users who simply can't edit? Is that intentional? Does it even make sense to have that behavior?

Would you be open to just removing that line from the clean layout in git so that users without the edit right can login from the clean layout?

Thanks!
/Rich

@malberts
Copy link
Contributor

Have you tried fixedhead.xml instead? It is basically the same as clean.xml but without the ShowOnlyFor modifications.

I believe clean.xml was created specifically to get rid of everything (for whatever purpose), although that was 9 years ago and long before my involvement.

@revansx
Copy link
Author

revansx commented Jul 23, 2023

indeed! thank you!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants