Embed view
This page is for designers who style content that editors embed in rich text: an image in an article, a related
article as a box, a video. The rich text's embed tag draws the object in the embed view mode.
Contents
The chain
- The rich text tag template
content/datatype/view/ezxmltags/embed.tplwraps the object in a<div>with the alignment and class the editor chose, and calls{content_view_gui view=$view content_object=$object object_parameters=$object_parameters ...}. (embed_node.tpldoes the same withnode_view_guiwhen a node is embedded.) content/view/embed.tpldraws the object; the kernel's default prints its name, linked to its main node.- Overrides on
Source=content/view/embed.tplgive classes their own embed.
What the embed template receives
$object, $object_parameters (from the editor: align, id, and custom attributes such as size for images),
$link_parameters, $classification (the class the editor chose), and $view.
Per-class embeds
[mytheme_embed_image]
Source=content/view/embed.tpl
MatchFile=embed/image.tpl
Subdir=templates
Match[class_identifier]=image{* override/templates/embed/image.tpl *}
<figure class="embed-image">
attribute_view_gui attribute=$object.data_map.image image_class=first_set( $object_parameters.size, 'medium' )
if $object.data_map.caption.has_content
<figcaption>attribute_view_gui attribute=$object.data_map.caption</figcaption>
/if
</figure>The media design has its embed overrides in override/templates/embed/. content.ini [embed] CustomAttributes[]
lists extra attributes editors may set (the shipped settings add gallery_view_mode for embedded galleries).
Alignment and classes
The wrapper's classes are object-left, object-right, object-center from align, plus the editor's class.
Style them in your stylesheet (with logical properties for left and right in right-to-left pages,
see Logical CSS properties).
Related pages
- Embed inline view
- Rich text templates
- content_view_gui
- Free documentation: this page is free to copy, translate and improve under the GNU FDL 1.3.
Become an Exponential Partner
Partners share their information, provide funding, contribute back and develop the products with us, and that is how Exponential grows. A partner website and dashboard are planned for mid-2027: please become a partner today to speed up our growth rate and land new features faster.