Roots Discourse

Sage 10 as Parent/Child Themes

Hello to everyone!

First of all many thanks to the Roots team for developing Sage 10, what will be an amazing product.

I developed a theme based on it with a couple of View Composers and many template files. Furthermore I changed the Namespace from App to Parent. When this theme is activated, everything is working as expected. But as soon as I want to use it as a Parent Theme, I am facing the following issues:

Eventhough the correct views are loaded from the parent theme, the View Composers are not loaded/fired from the parent theme. So if I have e.g. a value $siteName in the blade files which is defined in the Parent App.php, it is not loaded from the views and I get an PHP error about the not defined variable.

Furthermore I have some functions in the helpers.php of the parent theme with the namespace Parent. If I want to use them in the child theme via \Parent\function() I get the error that the function is not defined.

I am already autoloading the parent theme class via Composer autoload. So I assume that I am missing something very critical to build up an child/parent theme relation.

Any hint is very welcome, tnaks a lot!

Philipp

1 Like

Hey there! I’m not yet fully caught up to date with our latest changes in 10, so hopefully @QWp6t or @Log1x can chime in when they have a moment

I know https://github.com/roots/acorn/issues/1 has child theme support marked as completed

At the least we’ll be needing to document this, so I’d love to get a GitHub open issue about this if possible

Thank you for bringing this up

1 Like

Thank you @benword for getting back to me. I just opened a ticket: https://github.com/roots/sage/issues/2346

I’m really hoping for some advice from @QWp6t or @Log1x.

Best regards

1 Like