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

  • Sherlock

    Sherlock is a security scanner and monitor that keeps your site and CMS secure.
    PutYourLightsOn, April 18, 2016

  • Sprout SEO

    Content-focused SEO. Search, Structured Data, Social Media Sharing, Redirects, and Sitemap.
    Barrel Strength Design, March 04, 2014

  • Sprout Business Suite

    Forms, Email, SEO: Online business and marketing tools
    Barrel Strength Design, May 13, 2015


Plugin Development 101

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