SCSS/LESS Editor Field
Created 7 years ago by psaundersI have a custom LESS field attached to post to push out to the front end. How do you get the code to actually be processed so that it can either be added to a bundle, or, parsed inline in a twig file.
{{ post.style.parse }}
{{ post.style|raw }}
{{ post.style.render }} // 500s hunting for some file
The obvious ones above don't work
ryanthompson
—
7 years ago
Best Answer
You'll need to add it to an asset collection so use the EditorFieldTypePresenter
class in the editor field type to get the path to add to an asset collection:
{{ asset_add('styles.css', post.style.path) }}
You'll need to add it to an asset collection so use the
EditorFieldTypePresenter
class in the editor field type to get the path to add to an asset collection: