Difference between revisions of "Extensions:Theme Manager"

From Lorekeeper Wiki
Jump to navigation Jump to search
Tag: 2017 source edit
(Updating to LK 2.1.0)
Tag: 2017 source edit
Line 1: Line 1:
{{Extensioninfobox|title=Theme Manager|desc=Custom CSS themes for LK websites|auth=Preimpression|status=Testing|github={{Github|user=preimpression|branch=extension/theme-manager}}|migration=yes|package=no}}
+
{{Extensioninfobox|title=Theme Manager|desc=Custom CSS themes for LK websites|auth=Preimpression|status=Testing|github={{Github|user=preimpression|branch=extension/theme-manager}}|LKVer=2.1.0|migration=yes|package=no}}
  
'''This is on the Develop branch and therefore requires both Laravel 8 and Php 7.4'''
+
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.
 
 
Install custom themes on your Lorekeeper site. These are primarily CSS edits plus a custom header per theme - any hard code edits should be made in the actual blades. There is no "templating" such as in most forum softwares and you will have to upload full css files in order to edit them. The extension "cheats" the cache by creating false variables with the hash every time a theme is updated, so you won't have to fight with Cloudflare to update your cache for images or css if you have that set up for your site.
 
  
 
== Installation ==
 
== Installation ==
Line 18: Line 16:
 
== Configuration ==
 
== Configuration ==
  
'''The following file types can be header images:''' gif, png, jpeg, jpg, svg. It's advised that you either hard-code in your game's logo into the header box in '''app.blade.php''' or otherwise include it in each custom header image.
+
'''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.
  
Your site may have one Default Theme at a time. Default themes will be the default for guests and users who have not selected themes in their user settings panel. If no theme is set as default, it will appear as if the Theme Manager is not installed - aka it will be classic Lorekeeper or whatever custom css you have placed.
+
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 adjust any blades in a meaningful way, though it does make a tiny adjustment to comment code because I noticed that it looked super weird. Eventually I will PR that change into v.2.0.0 :)
+
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 ==
 
== Creating Themes ==
  
There will soon be a theme creation tutorial, though honestly it's mostly just sitting down with what you have and fiddling. I've created a [https://gist.github.com/preimpression/6973c4b311c962d5a7df51ef0a2ea8ff nifty dark mode theme] (no 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.
+
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 [https://gist.github.com/preimpression/6973c4b311c962d5a7df51ef0a2ea8ff 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.  
 
To access theme creation, there is a page in your admin panel called Theme Manager underneath File Manager.  
Line 35: Line 33:
  
 
== Troubleshooting ==
 
== 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 to below the theme css code.
+
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 ==
 
== See Also ==
 
For any questions and '''custom theme commissions''', contact Uri on Discord: Uri#2154.
 
For any questions and '''custom theme commissions''', contact Uri on Discord: Uri#2154.

Revision as of 19:31, 11 January 2023

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.