FriendsOfShopware / FroshEnvironmentNotice

Work in Progress
MIT License
8 stars 1 forks source link

Use Shopware templating stack while still injecting the notices #1

Open JoshuaBehrens opened 6 years ago

JoshuaBehrens commented 6 years ago

Currently the HTML and CSS is written manually and lack the possibility for easy styling and modifying like normal templating in Shopware (smarty, less, snippets).

Actual behaviour

Currently the notice is injected after the response is rendered. The notice is generated by constant HTML pattern and some database information. This is uneasy to maintain and extend.

Expected behaviour

I want to style the notice with the current Shopware stack. This should be easy for versioning and extending by using the Shopware templating stack. To maintain functionality of this plugin when exceptions in the templating stack occur there should be a plain fallback that point to the exceptions.

Checklist

JoshuaBehrens commented 6 years ago

Branch https://github.com/FriendsOfShopware/FroshEnvironmentNotice/tree/feature/templating

I added the events Frosh_EnvironmentNotice_NoticeMarkupBuilder_prepareView to add template directories and Frosh_EnvironmentNotice_NoticeMarkupBuilder_prepareViewData to filter the data that is passed into the view. The less variables is based on the selected themes. Mixins-support is missing as I am not sure what is the best way to get the right include path to the Bare theme.