LiipThemeBundle icon indicating copy to clipboard operation
LiipThemeBundle copied to clipboard

Support extending/including same template in another theme

Open Seldaek opened this issue 14 years ago • 8 comments

It would be nice if from the tablet theme, in the file FooBundle:Bar:baz.html.twig you could reference the same template in another theme like desktop. The syntax could be like: desktop:FooBundle:Bar:baz.html.twig.

Seldaek avatar Nov 01 '11 12:11 Seldaek

not sure if the added complexity is worth it. i mean if its not theme specific code, then why put it into a theme?

lsmith77 avatar Nov 01 '11 13:11 lsmith77

The benefit is just that you might want to say, for the listing of the homepage for example, I want to override the default template in my theme, but I still would like to extend it to reuse some stuff from it and not duplicate everything. Of course you can make both extend a third one that contains everything, but talking of added complexity.. :)

Seldaek avatar Nov 01 '11 13:11 Seldaek

sure, i can totally see a need for this, just not sure if we should add this, especially at the risk of coming up with a format that eventually could become incompatible. anyway, if there is a PR that doesn't turn the current code into a too complex mess, then i guess we can add it.

lsmith77 avatar Nov 01 '11 13:11 lsmith77

I would be interested by this PR too.

COil avatar Feb 28 '12 17:02 COil

me too!

skydiablo avatar Sep 05 '12 22:09 skydiablo

+1

oleg-andreyev avatar May 14 '14 10:05 oleg-andreyev

ping

lsmith77 avatar Jul 17 '14 09:07 lsmith77

For info, I found a way to do it directly :

  • in your theme, add a symlink to your «parent» theme : ln -s ../material parent
  • in your template, set parent with it path {% extends "WallabagCoreBundle::parent/layout.html.twig" %}

vibby avatar Oct 11 '17 16:10 vibby