Creating a theme

  • 2 months ago
  • 49 views
  • 0 comments

  • About 2 minutes to read

A theme let you customise the look & feel of your Plato site. If you want add your logo, customise the colours or wrap your design around Plato you will likely want to create a theme to achieve this.

Before attempting to create a new theme please ensure you understand how themes work.

A theme within Plato can be created either as a default theme or a custom theme. Default themes are available to all sites or tenants using your Plato instance whilst custom themes are site or tenant specific.

The differences between default themes and custom themes are further detailed below.

Creating a Default Theme

Default themes are created by hand and shared across all sites or tenants using your Plato instance.

Default themes are located within the Themes folder within the root of your Plato web application. At start-up Plato will traverse the Themes folder looking for theme.txt manifest files and will make any found themes available for selection to all sites or tenants via the general settings page and when creating new custom themes via the Plato.Theming module.

To create a default theme follow the steps below...

  1. Navigate to your Themes folder
  2. Create a copy of either the existing Default or Dark theme folder
  3. Rename your copied folder, for example MyTheme
  4. Open the MyTheme folder and update the theme.txt file to name your theme, this is the name shown on the general settings page within Plato. You can see an example below...
Name: My Custom Theme
Version: 1.0.0
PlatoVersion: 1.0.0
Author: Acme Inc
WebSite: https://www.acme.com/
  1. Save & close the theme.txt file and navigate to the general settings page
  2. You should now see My Custom Theme available for selection within the Theme drop down list on the general settings page. Select My Custom Theme and save your changes.

TIP To improve performance themes are cached in-memory. If you don't immediately see your new default theme available for selection on the general settings page you may need to manually recycle the IIS application pool or web site hosting your Plato installation. This will force Plato to traverse your Themes directory again to find your new default theme. You will only need to do this the first time you add your theme if the application has already been running.

After following the steps above Plato should now be using your new default theme. You can now edit MyTheme\Shared\_Layout.cshtml or MyTheme\theme.css to further visually customise your theme.

TIP Default themes are used as a basis for new custom themes created via the optional Plato.Theming module. The Plato.Theming module lets you create & customise themes via the Plato administrator dashboard. See "Creating a Custom Theme" below.

Unlike custom themes default themes are available to all sites or tenants using the same Plato instance. If you have multiple sites or tenants using the same Plato instance we would suggest creating a custom theme for each site or tenant as detailed below.

NOTE Default themes cannot be customised via the administrator dashboard and must be customised by hand within your favourite code editor or IDE such as Visual Studio or VS Code.

Creating a Custom Theme

Custom themes are created via the Plato.Theming module. This is an optional module you will need to enable within your Plato installation if you wish to allow for site or tenant specific themes. For more information on creating custom themes please see Plato.Theming.

Can we improve this doc? Login or register to tell us how
Your Feedback
Cancel
In this doc