Start page
Start page

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

editorId(...)

 

The editorId(...) function makes it possible to use Content Highlighting and EasyEdit in SiteArchitect or ContentCreator. 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 presentation channel 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 areIn order to enable these functions in a project, the templates (the HTML presentation channel 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 presentation channel:

<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.as.

Parameters for editorId() calls

  • 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 examples, refer to Template adjustment for multi-value input components (FS_LIST) and
    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: A FirstSpirit object can be passed using the “target” parameter (similar to the “element” parameter). In the process, not just objects of the IDProvider type, but also FirstSpirit objects (e.g. a FormDataList from an iteration using an FS_LIST section) 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.
    If, for example, an individual editor within an FS_LIST input component is to be identified, the editorId() call requires the following information:
    • “element ”parameter: Object that contains an FS_LIST
    • “target ”parameter: FS_LIST section's FormDataList object
    • “editorName ”parameter: Name of the FS_LIST section's input component
  • Some of this information can be determined from the generation context automatically and thus no longer needs to be passed within the template.
    For an example see Template adjustment for multi-value input components (FS_LIST).
    Another example of using the “target” parameter is identifying a dataset.
  • resolution: This parameter is only relevant for display in ContentCreator.
    The image cropping function can be activated in ContentCreator using this parameter. For more information, refer to Image cropping in ContentCreator.
  • reloadPreview:: This parameter is only relevant for display in ContentCreator.
    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.
  • editorName:: Passes the UID for an input component.
    For an example, see Template adjustment for input components.
  • meta: This parameter is only relevant for display in ContentCreator. 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).
    Note: the meta:true attribute can be used only in conjunction with the editorName parameter. When passing editorName, it has to be the UID of an input component from the metadata template.

If no parameter is passed, the current context is used automatically (e.g. the section or the page).

See also function editorID(...).

Important The editor identifiers are evaluated for both editing in ContentCreator (via EasyEdit or InEdit) and Content Highlighting in FirstSpirit SiteArchitect. Identifiable form elements receive an EasyEdit editing option and may receive one for InEdit (see supported input components (InEdit)) and, at the same time, allow Content Highlighting for these elements in SiteArchitect—both using the same template adjustment.
If this is not desired, different handling for SiteArchitect and ContentCreator has to be implemented in the HTML presentation channel (see SiteArchitect/ContentCreator case-by-case analysis).

The following highlights can be implemented:

© 2005 - 2015 e-Spirit AG | All rights reserved. | Last change: 2014-10-30