zenhack / mediawiki-sandstorm

Build of MediaWiki for Sandstorm
2 stars 1 forks source link

Custom logo feature #6

Open ocdtrekkie opened 2 years ago

ocdtrekkie commented 2 years ago

This is probably annoyingly non-trivial, unless an extension already exists for this somewhere: There is no way to change the logo displayed on the top left corner of every page away from the default. This was true for the original package as well, and an issue requesting it was opened. Annoyingly, the logo is set in the LocalSettings.php config file.

I imagine we could configure it to take the logo images from /var somewhere, and then copy the default images there on a fresh grain creation. But then to avoid people having to do the download/upload grain hack, we'd still need a way for people to upload their logo to that location. Maybe if we tell people to upload it with a specific filename via the MediaWiki interface, so we can grab it from there?

zenhack commented 2 years ago

Yeah, I looked a bit and found there was no "clean" way to do this. I'm not terribly motivated to fight with it, but open to others working on a solution.

Ideally mediawiki would grow a feature to change this via the admin settings, if someone wants to engage with upstream.

ocdtrekkie commented 2 years ago

Yeah, this is just one of those things I noticed is incomplete in cloning over my existing wiki to this package, though it's not really significant in the grand scheme of things.

https://www.mediawiki.org/wiki/Extension:LogoFunctions looks like it would probably do most of the job. It still requires setting the filename in the config, but it uses an uploaded file in the MediaWiki. So we could use this extension, and set the logo in all well known namespaces to WikiLogo.png or something similar, and then the user would just overwrite that image in MediaWiki to set the logo. We'd still need to sort uploading the default logo though for new grains, which is where it would get hairy.

zenhack commented 2 years ago

The repo already just checks in an initial database, because I couldn't find a better way to not have to do the manual setup configuration steps (go through a wizard, then download the generated config file and put it in place -- but it writes out the db during this step too). So we could probably just extend that somewhat unfortunate solution.

zenhack commented 2 years ago

Fwiw, the hosting provider my co-op went with has a default main page that starts with:

Main Page

Welcome to your new wiki!

To upload your logo, make sure your dimensions are at most 155px by 155px. Upload it at [Wiki.png]

The logo appears to just be blank until that is done.

ocdtrekkie commented 2 years ago

That seems reasonable. Though it looks like they deprecated the single-image logo config in favor of a set of them for different resolutions and use cases. Not sure how suboptimal it would be to just shove Wiki.png in all of them.