Element Variable for Craft CMS Access any element from templates.

Developed by Yuri Salimovskiy


Accepts 2 parameters: first is element type (e.g. 'MatrixBlock', 'Asset', 'Entry', 'Commerce_Variant') second is array of criterias to fetch the element (anything supported by ElementCriteriaModel)

Example usage: {{ craft.element.get('MatrixBlock', {'type': 'video'}).first().url }}

Commercial plugins

  • Sitemap

    Allows easy and powerful setup of XML sitemaps for search engines with full multi-locale support
    PutYourLightsOn, March 24, 2014

  • Smart Map

    Gives you a new "Address" fieldtype, from which you can (A) Render a Google map of your locations, (B) Sort your locations from closest to farthest, and (C) More good stuff!
    Double Secret Agency, March 17, 2014


Plugin Development 101

Don't miss any Craft tips, tricks, and community updates