caffeinated / themes

:art: Laravel Themes package with support for the Caffeinated Modules package.

Home Page:https://caffeinatedpackages.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Confussed about loading parent assets

nuno-iglesias opened this issue · comments

Hi,
I'm not sure if the behaviour that I'm watching is what i should expect or is not working properly.
Hi have setted two testing themes. One is a child of the other.

  • base (parent theme)
  • other (child theme)

In my test controler i'm doing something like this:

public function about(){
#return view('pages.about');
Theme::setActive('base');
Theme::setLayout('layouts.sidebar');
return Theme::view('pages.about');
}
I also have , in the views folder (in each theme) a template like this:
themes\base\views\pages\about.blade.html
themes\other\views\pages\about.blade.html

  • When accesing the view using the base theme (Theme::setActive('base')) i got what expected.

  • If i change the theme:
    > Theme::setActive('other')
    I got what expected (the other theme template)

  • If a remove the "other" theme template, I got the fallback template (from base theme).

Till now , everything is ok.
The problem comes with the assets.

  • if i include the asset in this way

I get the parent theme asset, not diference if I'm on using the parent or child theme.

  • if I include the asset in this way:

I get the CSS if the file exists in the current theme.
So, if i have "custom.css" defined in my parenttheme and not in my child theme. I do not get it.

What I'm expecting is that, if i have the "custom.css" in my theme (child) a can get it. And if the file is not present in the child theme, i got the fallback to the parent theme.
Tha is what is happening with views...

I'm quite sure I'm doing something wrong...
Any help will be appreciate.
Thanks a lot for your time.

hi did you manage to solve this?

commented

The package does not manage your assets between parent and child.