Problem/Motivation

When theming a Storage entity in twig, I can access the entity itself like this:

{{ elements['#storage'] }}

Most core entities go a step further and add their entity to the first level of Twig variables, so they can be accessed like this:

{{ node }}
{{ user }}

Proposed resolution

Do the same thing for storage entities, for consistency with Drupal core and better themer experience.

CommentFileSizeAuthor
#2 storage-321744-2.patch470 bytesles lim

Issue fork storage-3217444

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

Les Lim created an issue. See original summary.

les lim’s picture

Status: Active » Needs review
StatusFileSize
new470 bytes

Patch here.

les lim’s picture

Just trying out these issue forks for the first time, sorry for the noise. The MR is identical to the patch.

nanak’s picture

Status: Needs review » Reviewed & tested by the community

Fixed my issue, and inline with other entity types

mandclu made their first commit to this issue’s fork.

mandclu’s picture

Status: Reviewed & tested by the community » Fixed

Thanks for your work on this! Merged in, and will try to create a new release in the coming days.

  • mandclu committed 0bc2bba on 1.0.x authored by Les Lim
    Issue #3217444 by Les Lim: Expose storage entity as a top-level twig...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.