.. include:: /Includes.rst.txt .. _viewhelpers: ==================== ViewHelper Reference ==================== .. tip:: The Frontend Editing extension automatically includes its ViewHelpers in the `core` namespace, so you don't have to declare the namespace. .. _viewhelpers-contenteditable: contentEditable =============== Defines editable regions within Fluid templates. Arguments --------- table ~~~~~ :aspect:`DataType` string :aspect:`Required` true :aspect:`Description` The database table name to where the data should be saved. field ~~~~~ :aspect:`DataType` string :aspect:`Required` false :aspect:`Description` The database field to where the data should be saved. uid ~~~ :aspect:`DataType` string :aspect:`Required` true :aspect:`Description` The database field to where the data should be saved tag ~~~ :aspect:`DataType` string :aspect:`Required` false :aspect:`Description` The HTML tag to use for the editable wrapper. additionalAttributes ~~~~~~~~~~~~~~~~~~~~ :aspect:`DataType` mixed :aspect:`Required` false :aspect:`Description` Additional tag attributes. They will be added directly to the resulting HTML tag. data ~~~~ :aspect:`DataType` mixed :aspect:`Required` false :aspect:`Description` Additional data-* attributes. They will each be added with a "data-" prefix. Basic example ------------- This makes the field `bodytext` of the table `tt_content` editable: .. code-block:: html {bodytext} When frontend editing is enabled and the user is viewing the page in the Frontend Editing module in the backend, the output HTML will look something like this: .. code-block:: html
This is the content text to edit
When the user is viewing the page anywhere else than in the Frontend Editing module, or if Frontend Editing is disabled, the output HTML will look like this: .. code-block:: html This is the content text to edit Example with custom tag ----------------------- Using the `tag` argument, you can make a HTML tag into an editable region. In this case we are using an `