gremo / ZurbInkBundle

Creating email templates is hard. This Symfony Bundle provides help.
MIT License
24 stars 12 forks source link

zurb_ink_add_stylesheet only looks in src/ and Resources, it should also look in assets folder #6

Closed allan-simon closed 5 years ago

allan-simon commented 5 years ago

As of symfony4 it seems the prefered way to put css files is in the assets folder

however when I try to do

{{ zurb_ink_add_stylesheet('css/email.css') }}

it complains

An exception has been thrown during the rendering of a template ("The file "css/email.css" does not exist (in: /var/www/symfony4/src, /var/www/symfony4/src/Resources).").

Can it be made that it looks also through the assets folder ?

gremo commented 5 years ago

Can you make a PR? I'm not currently using Symfony 4, I'm not aware of the new structure for the assets folder.

allan-simon commented 5 years ago

hello thanks for the answer

I've tried to look around in the code but I haven't found any place that looks like "configure folder" so I'm a bit clueless where to start :(

gremo commented 5 years ago

Where the assets folder is officially documented?

allan-simon commented 5 years ago

It was more or less always stated as "that's the way it is" in their official tutorial https://symfony.com/doc/current/frontend/encore/simple-example.html

After installing Encore, your app already has one CSS and one JS file, organized into an assets/ directory:

https://symfony.com/doc/current/best_practices/web-assets.html

Store your assets in the assets/ directory at the root of your project.

as it is only stated here in the "best practice" section, I assume it's not something set in the rock

gremo commented 5 years ago

Correct me if I'm wrong but we are talking about email assets (that is, email stylesheets). Why we should put those assets into the assets folder? Is there any good reason?

allan-simon commented 5 years ago

the other alternatives rigth now is ./src/Resources which does not make more (or less, I agree) sense semantically , I just felt it was more natural to have them in assets/emails/

Bridn commented 5 years ago

As @allan-simon said, it would be more elegant if addStylesheet() method refers to twig asset method instead of ./src/Resources (bundle path), as of SF4/Flex ./src/Resources is now ./assets

gremo commented 5 years ago

@Bridn any clue on how to do this?

gremo commented 5 years ago

Done (my way). It works but it's not good.