liip / LiipThemeBundle

Provides theming support for Symfony bundles
MIT License
290 stars 76 forks source link

Assets structure in themes #144

Open l3xtrue opened 8 years ago

l3xtrue commented 8 years ago

I've been looking both documentation and google and I have not found information on how to incorporate themes in assets within the bundles so that the command "assets: install" install them in the web directory only from active theme.

If you placed them in Acme / DemoBundle / Resources / public / themes / current_theme / install all files from all themes but if I was within the theme folder Acme / DemoBundle / Resources / themes / current_theme / public / not copy anyone.

What is the correct structure? Do I need to configure anything else?

Thank you

julestruong commented 7 years ago

i second that

KoriSeng commented 6 years ago

For the themes can consider the following implementation

https://gist.github.com/7thcubic/701c0ff6aaa85511e80da5aece5bb798

https://gist.github.com/7thcubic/1817a6c83dd92189d8af76298243a6f1

after which it can be used like so.

  <link href="{{ asset('css/bootstrap.css' | theme ) }}" rel="stylesheet">

basically it will add /themes/currenttheme to the 'css/bootstrap.css'.