.. _Nng\Nnhelpers\ViewHelpers\ContentElementViewHelper: ======================================= contentElement ======================================= Description --------------------------------------- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Rendering a content element The ViewHelper that we probably use most often. Render content element from the table ``tt_content`` with the ``uid: 123``. .. code-block:: php {nnt3:contentElement(uid:123)} Render content element from the ``tt_content`` table where ``tt_content.content_uuid = 'footer'``. .. code-block:: php {nnt3:contentElement(uid:'footer', field:'content_uuid')} Replace variables in the rendered content element. Allows you to create a content element in the backend that works with fluid variables - e.g. for a mail template where the recipient's name should appear in the text. .. code-block:: php {nnt3:contentElement(uid:123, data:'{greeting:\'Hello!\'}')} {nnt3:contentElement(uid:123, data:feUser.data)} A ``contentUid`` does not necessarily have to be passed to render the variables. HTML code can also be parsed directly: .. code-block:: php {data.bodytext->nnt3:contentElement(data:'{greeting:\'Hello!\'}')} | ``@return string``