Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Assetic package 'ezdesign' not working in a {% stylesheets %} block #10

Open
alafon opened this issue Oct 4, 2016 · 4 comments
Open

Comments

@alafon
Copy link

alafon commented Oct 4, 2016

This works :

<link rel="stylesheet" href="{{ asset("css/default.css", "ezdesign") }}" />
<link rel="stylesheet" href="{{ asset("css/another_sheet.css", "ezdesign") }}" />

This does not :

{% stylesheets
    'css/default.css'
    'css/another_sheet.css'
    package='ezdesign'
%}
    <link rel="stylesheet" type="text/css" href="{{ asset_url }}"/>
{% endstylesheets %}

Am I doing something wrong ?

@lolautruche
Copy link
Owner

Never tried this... Didn't know about package option.
Do you have details on the error?

@lolautruche
Copy link
Owner

Anyway, I doubt this can work at all since Assetic compilation doesn't happen at run time, so you'll lose siteaccess context.

Best would be either to define assetic name assets instead, or just use Grunt/Bower

@alafon
Copy link
Author

alafon commented Oct 5, 2016

The package option is in the Asset Component, so it has nothing to do with assetic, you're right, sorry.

I don't know assetic very well but maybe custom filters could be used to lookup for the assets within the themes.

I was not able to find a lot of documentation regarding custom filter development and reverse engineering the source code of assetic is... well... 🗡 .
Found this at least :

If you want to add some hints and finally think that it can be accomplished I might give a hand 😄

@lolautruche
Copy link
Owner

I don't know assetic very well but maybe custom filters could be used to lookup for the assets within the themes.

Yes, but as I said, Assetic will know nothing about your siteaccess config. When you run assetic:dump, you'll use default siteaccess, so it's useless when using themes with different siteaccesses...

That's why I suggest to use named assets.

Assetic is quite rigid as it can't use dynamic references (e.g. variables inside stylesheets/javascripts tags)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants