Start page / Template development / Template syntax / Functions / in instructions / editorId

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.

Important 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.
For an example refer to Template adjustment for input components.

 

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.
The parameter expects the abbreviation of the language or the language object, e.g. language:"FR" or language:#global.getLanguage("FR").

ContentCreator only

entity

Passes an entity object
For an example refer to Template adjustment for database content.

 

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).
For example, refer to
Template adjustment for database content.

 

element

Passes a FirstSpirit object (from the IDProvider type) e.g., a GCA (#global.gca(„...“)) or a content area (#global.page.body(„...“)).
For an example refer to Template adjustment for content areas.

 

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.
The parameter is always relevant if the specified target object for the editorId() call cannot be determined directly from the generation context. This applies, for instance, to nested input components.
Another example of using the target parameter is identifying a dataset.

 

previewRulesEvaluation

This parameter is only relevant for display in ContentCreator.
You can use this parameter to deactivate rule evaluation (see also Chapter Rules) for specific elements during generation of the ContentCreator preview. This can be useful if rule evaluation causes long computation times during preview generation and thus impacts ContentCreator's performance.
The evaluation of rules is tied to a visualization: specifically in ContentCreator, rule infractions on the page that is currently displayed in the preview are shown in the page status and are indicated by a specific icon and highlighting. If rule evaluation during preview generation is deactivated by means of described previewRulesEvaluation, any validation problems that would have been detected by these rules will not be displayed in ContentCreator. See also #global.previewRulesEvaluation.
Note: For content based on table templates (datasets), rule infractions are never visualized in the preview.
Possible values are:

  • true: default value if the parameter previewRulesEvaluation is not set; the rules defined for this template (tab “Rules”) will be evaluated and visualized without limitation.
  • false: rule evaluation during preview generation in ContentCreator will be deactivated for the element associated with this use of editorId. In forms in ContentCreator and in SiteArchitect, rule evaluation and visualization of validation problems will be carried out as usual.

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.
If a valid HTML ID is specified via the parameter reloadElement (see below), reloadPreview has no effect.

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.
The ID of the desired HTML element can be passed as follows:
reloadElement:"container"
where container is the identifier of the element that can be defined with <div id="container">.
If the parameter reloadElement is defined, reloadPreview (see above) has no effect.

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.
See also ContentCreator: Editing external references (FS_INDEX).

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.

Important 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$ &nbsp; $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:

© 2005 - 2023 Crownpeak Technology GmbH | All rights reserved. | FirstSpirit 2023.2 | Data privacy