symfony-cmf / block-bundle

Extends the SonataBlockBundle to integrate with PHPCR ODM
https://cmf.symfony.com
20 stars 51 forks source link

Custom template when creating a Block #211

Open robhunt3r opened 10 years ago

robhunt3r commented 10 years ago

So it would be nice to can customize any block by writing a template path on Sonata Admin, for example a SimpleBlock now needs to edit CmfBlockBundle:Block:block_simple_createphp.html.twig (or without createphp) in order to customize a simple block, but it will affect every SimpleBlock which sometimes is necessary to have independent templates...

I don't know if this feature exists, to change template of a single block, but I've not found it unfortunately.

dbu commented 10 years ago

you need to dig through sonata block bundle for this a bit i think.

or just try if it happens to work when you use $block->setSetting('template', $myTemplate). probably needs a custom widget or something. and you want your templates in a dropdown, not have some content editor paste template names into a textfield...