Placeholders and Placeholder Definitions

Understanding Site Studio Web Sites 2-15

2.10 Placeholders and Placeholder Definitions

A Placeholder is an insertion point a tag on a page template see Section 2.12, Page Templates to identify where there is a contribution region that is, editable area on the web page. A placeholder is represented by a simple tag: --wcmPlaceholderName-- What the contribution region identified by the placeholder contains, and how it looks on the site, is defined using region templates and region definitions see Section 2.9, Region Templates and Region Definitions . A page template may contain multiple placeholders, each of which representing a contribution region on the page. There are no files associated with placeholders. Figure 2–11 shows a representation of a web page that contains one placeholder, marked with a dotted line with sample content. Figure 2–11 Placeholder on Web Page With Sample Content When you insert a placeholder in a page template, all you are doing is marking a named position in the template where content may be inserted. To control how content is handled at that position, you must associate the placeholder name with a placeholder definition. Placeholder definitions specify what content can go in the contribution region and how it is displayed, and the actions available to contributors. For example, a placeholder may be set up to allow contributors to update the metadata of content displayed in the contribution region, or they may be allowed to switch the content of contribution regions. Please note that region definitions control what kind of content contributors can switch to. 2-16 Oracle Fusion Middleware Developers Guide for Site Studio for External Applications Associating a placeholder with a placeholder definition also called mapping can be done in several ways: ■ At the site level using global mappings: You can set up default placeholder mappings that apply to the entire site unless any section-level or placeholder-level overrides are specified. You do this in Designer by opening the Tools menu and then choosing Define Placeholder Definition Mappings. This enables you to associate placeholder names with placeholder definitions for primary and secondary pages. The placeholder names are subsequently referenced in page templates. Placeholder names may be used on multiple templates in multiple sections and the mappings still apply. ■ At the section level using a section property: You can also set a specific placeholder definition mapping for the primary andor secondary page of a site section. If you establish the mapping in this way, then it replaces any mapping that may have existed at the site-wide global level. Please note that the section where you do this now uses different mapping from any other section where the same placeholder is used. ■ At the placeholder level using a parameter in the placeholder tag: You can also set a specific placeholder definition for a specific placeholder. You do this by adding the placeholderDefinitionDocName=[NAME] to the placeholder tag in source view. If you establish the mapping here, then this overrides all section-level and site-wide global mappings. It also means that this template uses this definition everywhere it used. The template then always uses the specified definition regardless of where in the site it is used. Also note that the only way to change this is to modify the template in source view. This would be considered the least flexible way of specifying a definition mapping as it is hard-coded, but this method can be used if desired. ■ As a catch-all using web site properties: You can set up a default placeholder definition that is used if none of the three other methods above apply. You do this by setting the Default Placeholder Definition property in the web site properties category of a site. You can also set up a default placeholder definition, which serves as a catch-all placeholder if no other applies. Placeholder definitions specify what content can go in a contribution region as marked by a placeholder tag and how this content is displayed, as well the actions available to contributors. For example, a placeholder may be set up to allow contributors to update the metadata of content displayed in the contribution region, or they may be allowed to switch the content of contribution regions. Please note that region definitions control what kind of content contributors can switch to. Placeholder definitions also specify what region definitions, region templates, and subtemplates are available for the associated placeholder that is, contribution region on the web page. Take, for example, a placeholder definition that allows three region definitions: REGION_DEFINITION_1, REGION_DEFINITION_2, and REGION_ DEFINITION_3. Region definition 1 has three associated region templates: A, B, and C, with region template A being the default one. This means that region template A is applied to all content files contributor data files or native documents associated with region definition 1 unless a different region template was specifically set. You generally associate a region definition with a content file when you create that file, although you can always change this association on the content information page see Section 2.2, Site Asset Storage . Understanding Site Studio Web Sites 2-17

2.11 Subtemplates