HTML Filters

  1. asset_url
  2. stylesheet_url
  3. stylesheet_tag
  4. javascript_url
  5. script_tag
  6. image_url
  7. img_tag

asset_url

Creates an asset url under assets_base_url.

Input
  {{ 'images/large/' | asset_url }}
Output
  '/assets/themes/example_theme/images/large/'

stylesheet_url

Generates url for given stylesheet.

Input
  {{ 'application.css' | stylesheet_url }}
Output
  '/assets/themes/1/stylesheets/application.css'

stylesheet_tag

Generates a stylesheet tag for given stylesheet url.

Input
  {{ 'application.css' | stylesheet_url | stylesheet_tag }}
Output
  <link href='/assets/themes/1/stylesheets/application.css' rel='stylesheet' type='text/css'  media='all'>

javascript_url

Generates url for given script.

Input
  {{ 'application.js' | javascript_url }}
Output
  '/assets/themes/1/javascripts/application.js'

script_tag

Generates a script tag for given script url.

Input
  {{ 'application.js' | javascript_url | script_tag }}

#### Output

~~~ html
  <script src='/assets/themes/1/javascripts/application.js' type='text/javascript'></script>

image_url

Generates image url for given image.

Input
  {{ 'rental.jpg' | image_url }}
Output
  '/assets/themes/1/images/rental.jpg'

img_tag

Generates an image tag for given image url.

Input
  {{ 'rental.jpg' | image_url | img_tag }}

Output

  <img src='/assets/themes/1/images/rental.jpg' alt='alt'>