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

Using 2 themes for one site

Started by Mario Lacunza 8 years ago · 3 replies · 733 views
8 years ago

Hi,
Im new with GRAV, I have a question for themes: so I want to use theme1 for the most part of the pages in the website (frontpage, contact, blog, etc), but for the Manual/Docs link I want to use the Learn2 theme is this possible? how can I do that?

8 years ago

@mlacunza Just a wild guess....

A theme/plugin can use the Asset Manager to addCss and removeCss. Maybe, by checking the url requested by the user, you can add/remove css depending on the url.

Never tried it, but it might be doable...

Some pseudocode:

PHP
$path = $this->grav['uri']->path();

if ($path startswith '/docs') {
  // addCss('my docs css file');
} else {
  // addCss('my regular css file');
}

Again, never tried it, but this comes first to mind...

Suggested topics

Topic Participants Replies Views Activity
Themes & Styling · by Sebadamus, 6 days ago
5 148 13 hours ago
Themes & Styling · by martynfoster735, 1 week ago
1 192 1 week ago
Themes & Styling · by Justin Young, 3 weeks ago
1 241 3 weeks ago
Themes & Styling · by Slebeig, 1 month ago
4 373 1 month ago
Themes & Styling · by Pedro M, 3 months ago
4 744 3 months ago