ezpublish - How to use ez_image_alias using twig -


i wanna use ez_image_alias() function dunno values have put in.

do have examples of how use function using twig ?

ez_image_alias twig function accepts 3 parameters:

  • field wish render
  • version info of content field located
  • variant name

starting content available in content variable in template, use ez_image_alias function this:

{% set variation = ez_image_alias(     ez_field(content, 'image'),     content.versioninfo,     'large') %} 

variation variable hold instance of ez\publish\spi\variation\values\imagevariation object can use render image:

<img src="{{ asset(variation.uri) }}" />


Comments

Popular posts from this blog

php - Vagrant up error - Uncaught Reflection Exception: Class DOMDocument does not exist -

vue.js - Create hooks for automated testing -

Add new key value to json node in java -