diff --git a/templates/_partials/entry/embed.twig b/templates/_partials/entry/embed.twig new file mode 100644 index 00000000..20ac4717 --- /dev/null +++ b/templates/_partials/entry/embed.twig @@ -0,0 +1,40 @@ +{# + This template is rendered whenever a CKEditor field’s content is output in + the front-end. The `entry` variable here is the element you created inside + CKEditor. You can access the element that CKEditor field is attached to via + the `owner` attribute. + + For performance, consider using `.eagerly()` when accessing relational + fields off of the embedded entry. This will allow Craft to lazily eager-load + other nested entries inside of the CKEditor field + + Each embedded/nested entry type gets its own template, named the same as its + entry type. This one will only be rendered for CKEditor fields that allow + creation of nested `embed` entries. +#} + +{% set attachment = entry.attachment.eagerly().one() %} + +