Renders an attribute value of a CMS object to a DOM element. The content can be edited by a logged-in Scrivito user.
Props
attribute(String) – the name of the attribute to be rendered.content(Obj,Widget) – the page or widget holding the attribute.tag(String) (optional) – tag name of the DOM element. Default:div- [New in 1.34.0 (BETA)]
dataContext(Obj,DataItem) – a CMS object or aDataItemto be used as a data context for all child components of thisContentTag. The correspondingDataItemcan be obtained in any of the child components viaScrivito.useDataItem. If a child components itself uses aContentTagwith thedataContextproperty, it will override any previously specified data contexts. - [New in 1.49.0]
renderEmptyAttribute(Boolean) – if set tofalse,Scrivito.ContentTagcomponents with an empty attribute value are not rendered on the live site and in “Preview” mode. This prop has priority overcontentTagsForEmptyAttributes. Default:undefined. - [New in 1.52.0]
ref(React.Ref) –React’s ref object or callback. Provides access to the underlying DOM element, enabling low-level DOM interactions. Default:undefined.
Other props are rendered as HTML attributes of the resulting tag.