Today there was a small discussion in the Slack-Channel (support).
If you want to add a widget or something to the Footer of your page you have to overwrite the template. If you want to make that "extendable" you can use "SonataBlockBundle" and use e.g.
{{ sonata_block_render_event('product.comment', {
'target': product.id
}) }}
To render the items at this position. E.g. there is a CommentBundle. To use the comments on the product-page I have to touch the template. If we'd define some Blocks there we could attach Widgets of the modules to different places.
Is this too heavy for standard-edition? I think it makes templating and modules much more flexible.
WDYT?
Our Shop bundle is meant to be an example and inspiration for your own templates, I am not sure we want to make it as extenable, most of the time you implement your own frontend with Sylius anyway, unless you build a prototype.
This could be useful for admin tho, which is often customized, not overwritten entirely. I will have a look at sonata.
@pjedrzejewski it's already used in the "cms-bundle" so you maybe know already ;-)
Our Shop bundle is meant to be an example and inspiration for your own templates
I know that, and for sure it's mostly the case. But in some cases you cane use them.
(For example the checkout is nice and can be used as is.)
In other shop systems like Magento/Shopware/whatever it's really common to use a "base theme" instead of reinventing the wheel. Sylius has by far the best possibilities to overwrite themes.
This could be used to make the most flexible frontend, too.
Oh, maybe it's related to https://github.com/Sylius/Sylius/issues/2655 because of the "cache layer".
It provides an extra layer for setting the correct response headers (or at least a configurable fallback).
I think this would be a great extra for Sylius.
In reality I think a lot of people do not want to implement their own front-end 100%. I prefer to use things from the base theme provided with Sylius. E.g. cart in header, base of cart page, checkout, etc.
Next to that, certain functionality would be perfect to share as a Bundle, but would need template integration by the developer integrating. The adoption rate and the amount of extensions probably raises a lot when it kind of plug and play to add certain functionality.
I can think of a cookie consent bar, a button in admin to download invoice PDF (without adding the button yourself), add certain JS in header / footer (live chat, e.g.), integrate an external review module, etc. All these things can be implemented by a developer into a template and the rest of the functionality can be provided in the Bundle, but the easier the better for a higher adoption rate and more open-source extensions.
Ofcourse Sylius is far from similar to Magento, WooCommerce, etc. But I guess that the easier it will be to set-up a complete shop using bundles and extensions, the more users will start using Sylius.
Another thing that crosses my mind are features like integration of Google Tag Manager combined with eCommerce Tracking (thank you page etc.). You don't necessarily want to override the full thank you page template, but only insert some stuff in there. If this could be done from an extension without overriding all, that would be great imo.
Seems to be implemented now. So this one can be closed?
https://github.com/Sylius/Sylius/blob/master/src/Sylius/Bundle/ShopBundle/Resources/views/layout.html.twig
Yes, looks good to me.
Most helpful comment
I think this would be a great extra for Sylius.
In reality I think a lot of people do not want to implement their own front-end 100%. I prefer to use things from the base theme provided with Sylius. E.g. cart in header, base of cart page, checkout, etc.
Next to that, certain functionality would be perfect to share as a Bundle, but would need template integration by the developer integrating. The adoption rate and the amount of extensions probably raises a lot when it kind of plug and play to add certain functionality.
I can think of a cookie consent bar, a button in admin to download invoice PDF (without adding the button yourself), add certain JS in header / footer (live chat, e.g.), integrate an external review module, etc. All these things can be implemented by a developer into a template and the rest of the functionality can be provided in the Bundle, but the easier the better for a higher adoption rate and more open-source extensions.
Ofcourse Sylius is far from similar to Magento, WooCommerce, etc. But I guess that the easier it will be to set-up a complete shop using bundles and extensions, the more users will start using Sylius.