Page-related #global invocations
The demands made of a website are very many and diverse. For example, several websites are multi-lingual, others are monolingual. Several have several content areas - others only have one single one.
Page-related information and mechanisms are required for the display and linking of complex websites with multi-lingual pages and several content areas.
In FirstSpirit, the system object #global can be used to access site-related information (includes, among other things, pages, sections, page references, content areas, etc.).
The most important page-related invocations are listed in the following table:
Invocation | Meaning | Return data type |
---|---|---|
#global.gca("IDENTIFIER") | Insert the contents of a global page from Global Content Area . | |
#global.id | Returns the ID of the currently rendered node (e.g. page, section, etc.). | |
#global.docgroup | Determines whether the current node is a document group or not. | Boolean |
#global.node | Returns a page reference or a document group. | Depending on the node: |
#global.node.changeDate | Returns the change date of the page reference. | |
#global.node.depth | Returns the depth of the page reference relative to the root node of the Site Store. The counting begins with 0 for the root node. | |
#global.node.editor | Returns the last editor of the page reference. | |
#global.node.editor.abbreviation | Returns the abbreviation of the last editor of the page reference. | String |
#global.node.editor.eMail | Returns the eMail address of the last editor of the page reference. | String |
#global.node.editor.phoneNumber | Returns the phone number of the last editor of the page reference. | String |
#global.node.editor.realname | Returns the name of the last editor of the page reference. | String |
#global.node.id | Returns the ID of the page reference. | |
#global.node.keywords | Returns a list of all key words for the page reference. This list results from the union of sets of all key words defined in the Site Store along the tree structure (starting from the current page reference up to the root). | |
#global.page | Returns the page from the Page Store. | |
#global.page.body("IDENTIFIER") | Returns a content area. | |
#global.page.changeDate | Returns the change date of the page. | |
#global.page.depth | Returns the depth of the page relative to the root node of the Page Store. The counting begins with 0 for the root node. | |
#global.page.editor | Returns the last editor of the page. | |
#global.page.editor.abbreviation | Returns the abbreviation of the last editor of the page. | String |
#global.page.editor.eMail | Returns the eMail address of the last editor of the page. | String |
#global.page.editor.phoneNumber | Returns the phone number of the last editor of the page. | String |
#global.page.editor.realname | Returns the name of the last editor of the page. | String |
#global.page.id | Returns the ID of the page. | |
#global.page.isTranslated | Determines whether, for the page in the current language, the attribute Page completely translated for this language is set. | Boolean |
#global.page.isTranslated("IDENTIFIER") | Determines whether, for the page in the given language, the attribute Page completely translated for this language is set. The abbreviation of the language (e.g. EN) must be given as the identifier. | Boolean |
#global.ref | Returns, similar to #global.node, the current page reference or a document group. | Depending on the node: |
#global.section | Returns the section in a section template. If the current object is not a section, null is returned. | |
#global.section.changeDate | Returns the change date of the section. | |
#global.section.depth | Returns the depth of the section relative to the root node of the Page Store. The counting begins with 0 for the root node. | |
#global.section.editor | Returns the last editor of the section. | |
#global.section.editor.abbreviation | Returns the abbreviation of the last editor of the section. | String |
#global.section.editor.eMail | Returns the eMail address of the last editor of the section. | String |
#global.section.editor.phoneNumber | Returns the phone number of the last editor of the section. | String |
#global.section.editor.realname | Returns the name of the last editor of the section. | String |
#global.section.id | Returns the section's ID. | |
#global.section.name | Returns the name of the section. Can be used to create manual references to automatically generated anchors. | String |
Examples
Several examples of use of the instruction within templates are shown in the following. The examples are intended to clearly show the specific effect of the instruction and provide help for the template developer when creating their own templates.
The examples displayed here must be adjusted for use within a project! For example, variable names must be changed to the specific variable names of the project in which the instruction is to be used. |
1st Example: Output of the last editor
Last change on $CMS_VALUE(#global.page.changeDate.format("dd.MM.yyyy"))$ by $CMS_VALUE(#global.page.editor.realname)$
The example outputs the last change to the page formatted and the name of the editor.
Output:
Last change on 27.06.2007 by Mustermann
2nd Example: Language change
<a href="$CMS_REF(#global.ref, lang:"EN")$">Page in English</a>
The instruction $CMS_REF(...)$ is used to determine the URL of the actual node in another language.
Output:
<a href="/preview/671041/show/site/EN/current/671044/681046">Page in English</a>
3rd Example: Changing the presentation channel
<a href="$CMS_REF(#global.ref, templateSet:"print")$"Print version</a>
The instruction $CMS_REF(...)$ is used to determine the URL of the current node in another presentation channel.
Output:
<a href="/preview/671041/show/site/DE/current/671086/681046">Print version</a>