liip / LiipThemeBundle

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

Introducing parent/child themes #127

Open ahilles107 opened 9 years ago

ahilles107 commented 9 years ago

What do you think about idea of declaring parent theme for theme and parameter parent_theme in path_patterns ? This would allow for us implement themes updating and keeping customer/user theme changes not removed.

Something like:

themes: 
  theme_1: ~
  theme_2: ~
  theme_3: 
    parent: theme_1
ahilles107 commented 9 years ago

@lsmith77 - what do You think?

lsmith77 commented 9 years ago

should't twig inheritance be sufficient?

wizhippo commented 9 years ago

I think using theme cascading order could be used here. It would be nice if there was a way to change the patterns based on the current theme selected so you could add base themes to the cascade order based on the active theme..

Perhaps the FileLocator could be changed to allow changing the patterns and then some listener to update the cascade order based on the current theme?

oleg-andreyev commented 6 years ago

@wizhippo I my company we've have quite complicated template inheritance, and we've achieved that using path_patterns will all paths.