WEBeditInplaceEditBegin / End
The render format templates WEBeditInplaceEditBegin and WEBeditInplaceEditEnd can be used in page, section and table templates. In section and table templates, they provide the content highlighting function at section level (see also Page Store: Sections), in page templates they enable the highlighting of all content entered and maintained at page level (see also Page Store: Pages).
Each WEBeditInplaceEditBegin expression must be closed again by a WEBeditInplaceEditEnd expression. Both calls surround the HTML area which is to be highlighted in the integrated preview on selecting a section in the tree structure.
Nesting should not be used at all: each WEBeditInplaceEditBegin should be closed again with WEBeditInplaceEditEnd first before the next WEBeditInplaceEditBegin.
By using WEBeditInplaceEditBegin and WEBeditInplaceEditEnd, additional <div> containers are also inserted. |
<body>
$CMS_RENDER(template:"WEBeditInplaceEditBegin")$
...
$CMS_RENDER(template:"WEBeditInplaceEditEnd")$
</body>
However, calls of the render format template WEBeditInplaceAttributeBegin/End can be used between both calls.
Highlighting data record sections
Datasets are usually entered and maintained centrally in the Content Store, however, they can be output in several places of a website with the help of different table templates and therefore different layouts. In these cases, the link between the workspace in which the datasets can be edited using input components and the integrated preview in which the content from these input components is highlighted, is possibly not given automatically (see also Content Store: Input components).
Example: On a company website, press releases or product information is maintained as individual datasets in data sources (content). These are output on the one hand on individual pages (one page per press release or product description), on the other hand on an overview page, on which, for example, only certain content of the datasets is output ("Teasers"). The individual and overview page are based on different table templates, however, only the table template for the individual pages contains the input components for entering and maintaining the datasets. The "Form" tab of the table template for the overview page is empty. In the output, it draws its content from the data source with the individual datasets.
For the table template for which no input components are defined (overview page), several pieces of missing information must be given manually to ensure a correct link between the view in the workspace and the integrated preview; this is done using the content, id, pageRef and view parameters.
All templates which output the same data record must have the same values for these parameters.
These parameters are explained in the following using the given example.
content
This parameter is usually used in templates which output datasets but do not provide any forms for entering data, or for datasets which are output using the contentSelect function. This parameter is used to given the UID of the table template in which the maintenance screen form (forms) is deposited. The content parameter must be used with the index parameter.
In the example, content is used in the table template for the press release overview pages to give the UID of the same table template.
index
This parameter is used to give the ID of the data record which is to be displayed in the workspace, directly in double inverted commas or dynamically, e.g. using the system object #row. This parameter must be used together with the content parameter.
A differentiation is made between the following cases for use of content and index:
- Content projection (section based on a table template): content and index are filled with default values, but can be manually overwritten.
- Datasets which are output using the contentSelect function in a content projection: content and index are filled with default values (potentially incorrectly) and can or must be manually changed accordingly.
- Datasets which are output using the contentSelect function outside a content projection: content and index are not filled with default values and must be given manually.
view
This parameter gives the UID of the data source (content) in the Content Store, in which the maintenance screen form (forms) for the data record are deposited. The parameter must be given in each template via which datasets are output.
In the example, for both templates (for the table template for individual press release pages and for the template for press release overview pages), the view parameter is given with the data source in which the press releases are maintained.
pageRef
This parameter must be given in table templates or in a ContentSelect, which have no maintenance screen forms (forms). It gives the page reference which outputs the corresponding table template with maintenance screen form. The table template is to be selected, via which the same data record is entered / maintained, as that which is output via the table template which has no maintenance screen form.
A page reference object can be transferred to the parameter. Alternatively, the ref(...) function can be used to give the page reference object.
In the example, for the template for the individual press release pages, the parameter pageRef is given as the page reference to a page on which the individual press releases are integrated.
The content, index, view and pageRef parameters must be given with each call of WEBeditInplaceAttributeBegin, e.g.
$CMS_RENDER(template:"WEBeditInplaceEditBegin", content:"Products.contacts", index:contactEntity.getId(), view:"kontakte")$
To use the parameters for the whole page, section or table template, $CMS_SET(...)$ can be used before the call of WEBeditInplaceEditBegin to define a value for each parameter, e.g.
$CMS_SET(content, "Products.press_releases_overview")$
$CMS_SET(index, #row.getId())$
$CMS_SET(pageRef, ref(pageref:"pressreleasesdetails"))$
$CMS_SET(view, "pressreleases")$
The values defined here are available in the context of the respective template and in the overall deeper context. Therefore, it is necessary to ensure that overlapping does not occur in that, e.g. for uses of WEBeditInplaceEditBegin/End in a deeper content, different values are defined for the content, index, pageRef and view parameters! |
Parameters for highlighting datasets
The content, id and pageRef parameters are only required for table templates which output datasets, but do not contain any maintenance screen forms (forms), and for datasets which are output using the contentSelect function. |
Parameter | Explanation / Example |
---|---|
content | Specification of the UID of the table template in double inverted commas, in which the corresponding maintenance screen form is deposited, e.g. |
index | Specification of the ID of the data record, which is to be displayed in the integrated preview. The ID is given directly in double inverted commas or, e.g. dynamically using the system object #row
, e.g. |
view | Specification of the UID of the data source in the Content Store, which is to be displayed in the workspace if a data record in the integrated preview is clicked, which is rendered by the respective template, e.g. |
pageRef | Specification of the page reference which is defined in the template with the maintenance screen form (forms), e.g.: |
Parallel use with Easy Edit
The content and index parameters are used for both content highlighting and for the Easy Edit function and can be used in parallel. For notes on use and restrictions in Easy Edit see there.