Skip to content
Grav 2.0 is officially stable. Read the announcement →
Themes & Styling

Chosing inherited theme in admin panel

first-time theme

Started by nwi 5 years ago · 10 replies · 860 views
5 years ago

Hi, I have created a child theme to Quark following the manual guide. But how do I swap to the new theme? It is not displayed in the admin / themes page. Or are child themes not displayed there?

5 years ago

For me the manual way is easier as I don't really understand the CLI way to do it.

5 years ago pamtbaau @nwi, If properly defined a child theme shows up in Admin. I would suggest to use the easi…

Thank you for your advise, pamtbaau.
For me the manual way is easier as I don't really understand the CLI way to do it.

This is what I did:

  1. Created the folder user/themes/mgb-theme
  2. Copied the YAML file an added the code as described.
  3. Copied the blueprints.yaml
  4. Changed the config/system.yaml.
  5. Created a new theme Class file.

Screenshot 2021-10-26 151717|690x216

Is there anything obviously wrong? Thanks for any tipps.

5 years ago

@nwi, Have you tried the CLI method to see if that creates a functional child theme?

5 years ago

Hi @nwi
 

In your "mgb-theme.php" file try

PHP
<?php
namespace Grav\Theme;

use Grav\Common\Theme;

class MgbTheme extends Quark
{
    // Access plugin events in this class
}

Note:

  • NEW ADD : use Grav\Common\Theme;
  • Lowercase letter to uppercase : class Mgbtheme to class MgbTheme

 
The sub-theme must be visible in the backoff > theme 🙂

 
Sincerely
Kit

1 reply
5 years ago

@nwi what's in your blueprints.yaml file ?
mbg-theme > blueprints.yaml

<details>
<summary>My blueprints.yaml</summary>

TXT
name: Mbg Theme
slug: mbg-theme
type: theme
version: 0.1.0
description: xxx
icon: rebel
author:
  name: xxx
  email: [email protected]
homepage: https://github.com/xxx/grav-theme-mbg-theme
demo: http://demo.yoursite.com
keywords: grav, theme, etc
bugs: https://github.com/xxx/grav-theme-mbg-theme/issues
readme: https://github.com/xxx/grav-theme-mbg-theme/blob/develop/README.md
license: MIT
dependencies:
  - { name: grav, version: '>=1.6.0' }

</details>

Suggested topics

Topic Participants Replies Views Activity
Themes & Styling · by Sebadamus, 2 days ago
3 73 3 hours ago
Themes & Styling · by martynfoster735, 4 days ago
1 161 3 days ago
Themes & Styling · by Justin Young, 3 weeks ago
1 221 2 weeks ago
Themes & Styling · by Slebeig, 1 month ago
4 349 1 month ago
Themes & Styling · by Pedro M, 3 months ago
4 708 3 months ago