editorId(...)
Contents |
The editorId(...) function makes it possible to use Content Highlighting and EasyEdit in SiteArchitect or ContentCreator as well as LiveEdit. These functions help you control and edit form-based store elements and input components within the preview modes using a form, EasyEdit/InEdit and drag-and-drop.
The complete documentation with application examples and information on using the function in SiteArchitect and ContentCreator is available in the section titled Using Content Highlighting and EasyEdit in projects. |
In order to enable these functions in a project, the templates (the HTML template set in this case) have to be adjusted. The principle is identical for both functions. It must be possible to uniquely reference HTML elements, which are to be highlighted, within an HTML page. On the technical side, “editor identifiers” are used, which the template developer can store in HTML templates for the project. An editorId() call is used for this purpose. For instance, the name of an input component can be passed as a parameter.
For instance, the call
$CMS_VALUE(editorId(editorName:"pt_headline"))$
ensures that the value of the “pt_headline” input component is highlighted in the HTML template set - regardless of whether the editor would like to edit this content in SiteArchitect or in ContentCreator.
Each “editor identifier” has to be assigned to a suitable HTML element. This includes HTML tags for displaying content in blocks, such as <h> tags for displaying headers (<h1>, <h2>, <h3>, etc.) and the <p> or <div> tag for displaying large content areas order to enable these functions in a project, the templates (the HTML template set in this case) have to be adjusted. The principle is identical for both functions. It must be possible to uniquely reference HTML elements, which are to be highlighted, within an HTML page. On the technical side, “editor identifiers” are used, which the template developer can store in HTML templates for the project. An editorId() call is used for this purpose. For instance, the name of an input component can be passed as a parameter.
For instance, the call:
$CMS_VALUE(editorId(editorName:"pt_headline"))$
ensures that the value of the “pt_headline” input component is highlighted in the HTML presentation channel - regardless of whether the editor would like to edit this content in SiteArchitect or in ContentCreator.
Each “editor identifier” has to be assigned to a suitable HTML element. This includes HTML tags for displaying content in blocks, such as <h> tags for displaying headers (<h1>, <h2>, <h3>, etc.) and the <p> or <div> tag for displaying large content areas. Thus, in order to highlight a header, editorId() has to be called within the <h> element in the HTML template set:
<h3$CMS_VALUE(editorId(editorName:"pt_headline"))$>
In addition to highlighting HTML content by block, element-specific highlighting, such as an image in an <img> tag, can be implemented in this way as well:
<img src="$CMS_REF(st_picture)$" alt="" $CMS_VALUE(editorId(editorName:"st_picture"))$ />
In addition to the name of an input component, it is possible to pass other parameters as well:
Parameters for editorId() calls
Parameter name | Description | Scope |
---|---|---|
editorName | Passes the UID for an input component. | |
language | By default, forms are initially opened in the current language (#global.language). This parameter can be used to specify a language in which a form should be opened. | ContentCreator only |
entity | Passes an entity object | |
template | Passes a table template (TableTemplate object) or the UID for a table template (as a string, e.g., schema.gallery). | |
view | Passes a data source (Content2 object) or the UID for a data source (as a string). | |
element | Passes a FirstSpirit object (from the IDProvider type) e.g., a GCA (#global.gca(„...“)) or a content area (#global.page.body(„...“)). | |
target | Passes a FirstSpirit object (similar to the element parameter). In the process, not just objects of the IDProvider type, but also FirstSpirit objects can be passed using target. | |
previewRulesEvaluation | This parameter is only relevant for display in ContentCreator.
Example: <div$CMS_VALUE(editorId(previewRulesEvaluation:false))$>...</div> | ContentCreator only |
resolution | The image cropping function can be activated in ContentCreator in the preview using this parameter. For more information, refer to Image cropping in ContentCreator. | ContentCreator only |
reloadPreview | If changes are made in a subsection of the HTML page using the EasyEdit or InEdit function, such as changing a heading, then only this modified HTML area is refreshed and replaced on the HTML page. This allows for quick refreshing of the page preview. This targeted refresh does not catch some changes, since the changes are outside the current HTML area. In this case, the entire page can be loaded using the reloadPreview parameter (reloadPreview:true). Loading the entire page for changes made using the EasyEdit or InEdit function in ContentCreator is switched off by default. | ContentCreator only |
reloadElement | By default, the element with the indicated editorId is reloaded after having edited a page. You can use reloadElement to pass the ID of an HTML element that is to be loaded after having edited the page. | ContentCreator only |
json | The parameter is required only when new list entries are to be added via the FS_BUTTON handler class NewListEntryExecutable in ContentCreator within the input components: If, within the editorId parameter, the json parameter is specified as json:true, then a JSON object is returned instead of an HTML fragment (see Example). The parameter may only be used within JavaScript (not in the HTML output, as in such cases invalid HTML will be generated. | ContentCreator only |
meta | When using the InEdit function, if the metadata for a FirstSpirit object (such as pages, sections, media, etc.) is to be edited instead of the editorial form content, the meta:true parameter can be set in the editorId() call. In this case, the form for editing metadata is opened instead of the form for editing editorial content when the InEdit function is activated. Editing metadata using the InEdit function in ContentCreator is switched off by default (refer to Edit metadata for examples). | ContentCreator only |
externalReference | This parameter is only relevant for use in ContentCreator in conjunction with FS_INDEX, which does not use DatasetDataAccessPlugin, for example FirstSpiritFragmentAccess. | ContentCreator only |
If no parameter is passed, the current context is used automatically (e.g., the section or the page).
For more information, see also the editorID(...) function.
The editor identifiers are evaluated for both editing in ContentCreator (via EasyEdit, InEdit, or LiveEdit) and Content Highlighting in FirstSpirit SiteArchitect. In ContentCreator, the identifiable form elements can be edited with EasyEdit editing and possibly also with InEdit and LiveEdit (see Supported input components (InEdit) and the LiveEdit page for more information). At the same time, this process enables Content Highlighting for these elements in SiteArchitect – both using the same template adjustment. If this is not desired, different handling for SiteArchitect and ContentCreator must be implemented in the HTML template set (see SiteArchitect/ContentCreator case-by-case analysis). |
Empty check
It should be avoided to create empty tags for the editorId of an element. This can result in no Content Highlighting or EasyEdit frame being drawn. Tags should at least be output with a substitute content (e.g. a non-breaking space).
Example:
<div $CMS_VALUE(editorId())$>
<h3$CMS_VALUE(editorId(editorName:"st_headline"))$>
$CMS_IF(!st_headline.isEmpty)$
$CMS_VALUE(st_headline.convert2)$
$CMS_ELSE$ $CMS_END_IF$
</h3>
</div>
In case st_headline is empty, the $CMS_ELSE$ call in the $CMS_IF(...)$ contruct ensures that a space is put in the h3 tag and that the content highlighting or EasyEdit frame is displayed.
The following highlights can be implemented:
Page Store
Content Store
Other content