Skip to content

Twig templates and hook_format_strawberryfield_twigcontext_alter functions don't know who is calling them #279

@patdunlavey

Description

@patdunlavey

It would be useful to have a value in the $context variable that is passed to the \Drupal\format_strawberryfield\Entity\MetadataDisplayEntity::renderNative and \Drupal\format_strawberryfield\Entity\MetadataDisplayEntity::processHtml functions which indicates who is calling them. This would also be valuable to have prior to \Drupal::moduleHandler()->alter('format_strawberryfield_twigcontext', $context);

A couple use cases:

  1. A user wishes to use the same metadatadisplay template for MODS export as for OAI, but when it's OAI, needs to not render the xml wrapper elements.
  2. A users wishes to add/alter elements in the $context when running AMI, but not when displaying object metadata.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions