HTML Filters

This collection of filters provide means to create easily common HTML tags.


img_tag

Creates an img element.

Input

 {{ 'my-image.png' | img_tag }}
 {{ 'my-image.png' | img_tag: 'My Image', 'image-class' }}
 {{ product.image | img_tag }}

Output

 <img src="my-image.png">
 <img src="my-image.png" alt="My Image" class="image-class">
 <img src="https://product-image-url">

script_tag

Creates a script tag.

Input

 {{ '/asset/my-script.js' | script_tag }}

Output

 <script src=""/asset/stylesheet.css"></script>

stylesheet_tag

Creates a stylesheet tag, accepts media type as a first argument and media type as a second argument.

Input

 {{ '/asset/stylesheet.css' | stylesheet_tag }}

Output

 <link href="/asset/stylesheet.css" type="text/css" media="all">