Extensions:Theme Manager

From Lorekeeper Wiki
Revision as of 20:31, 11 January 2023 by Preimpression (talk | contribs) (Updating to LK 2.1.0)
Jump to navigation Jump to search
Theme Manager
Description Custom CSS themes for LK websites
Author(s) Preimpression
Status Testing
Github extension/theme-manager
LK Version 2.1.0
Contains a Migration



Custom themes can be installed on your Lorekeeper site. These themes primarily consist of CSS edits and a custom header image. Any changes to the hard code should be made directly in the blades. The software does not have a "templating" feature like in many forum platforms, so you will need to upload full CSS files when you make edits. The theme extension bypasses caching by creating fake variables with a hash each time a theme is updated, which eliminates the need to clear Cloudflare's cache for images or CSS files if your site has that set up.

Installation

Screenshot of Generic Dark Mode theme by Preimpression.
Example of a theme (Generic Dark Mode by Preimpression) in action.

- Pull/Merge in the branch

- Run php artisan migrate

- Run php artisan update-extension-tracker

- Run php artisan optimize (twice)

Configuration

The file types that can be used for header images are gif, png, jpeg, jpg, svg. It's recommended to include your game's logo in the header box located in app.blade.php file or include it in every custom header image.

A website can only have one default theme at a time. This theme will be applied to guests and users who have not chosen a theme in their settings. If no theme is designated as the default, it will appear as if the theme manager is not installed and the site will display in its basic, default style.

The code does not make any significant changes to any blades, but it does make a small modification to comment code because it was visually unappealing.

Creating Themes

There will eventually be a theme creation tutorial, though honestly it's mostly just sitting down with what you have and fiddling. I've created a nifty dark mode theme (sans header image) that you can see, using a large number of CSS variables. CSS variables are ideal because you can edit them at the top of the file and they will propagate over wherever they're used.

To access theme creation, there is a page in your admin panel called Theme Manager underneath File Manager.

Free Use Themes

Troubleshooting

No known issues, however if you wish for custom.css code to be maintained regardless of theme, open app.blade.php and move the custom css code call to be below the theme css code call.

See Also

For any questions and custom theme commissions, contact Uri on Discord: Uri#2154.