SEOshop Documentation

URL filters

url

The url filter transforms a relative URL into an absolute URL.

{{ product.url | url }}

Output:

http://www.your-domain.com/product.html

url_core

The url_core filter transforms a relative system URL into an absolute system URL.

{{ 'gui.js' | url_core }}

Output:

http://assets.webshopapp.com/core/gui.js

url_asset

The url_asset filter transforms a relative asset URL into an absolute asset URL.

{{ 'stylesheet.css' | url_asset }}

Output:

http://assets.webshopapp.com/your-shopdomain/stylesheet.css?1

url_image

The url_image filter transforms an image ID into an absolute image URL.

{{ product.image | url_image }}

Resize method 1

The url_image filter takes two optional arguments to adjust some settings.

The first argument: WIDTH x HEIGHT x RESIZE METHOD

There are 4 resize methods to create different image sizes.

Resize method 1 (fill): resizes and crops the image so it will fit the given dimensions.

{{ product.image | url_image('400x250x1') }}

Resize method 1

Resize method 2 (fit): resizes the image so it will fit the given dimensions.

{{ product.image | url_image('400x250x2') }}

Resize method 2

Resize method 3 (fit): resizes the image so it will fit the given dimensions and removes white space.

{{ product.image | url_image('400x250x3') }}

Resize method 3

Resize method 4 (exact): stretches the image so it will fit the given dimensions.

{{ product.image | url_image('300x150x4') }}

Resize method 4

The second argument can be used for generating a SEO friendly URL:

{{ product.image | url_image('200x200x1', product.title) }}

http://cdn.webshopapp.com/i/zzhmyv/200x200x1/seo-friendly-product-title.jpg

url_encode

The url_encode filter URL encodes a given string.

{{ data | url_encode }}
Was this article helpful? Yes No
One moment please
Thanks for your feedback.