About Fragments Oracle Fusion Middleware Online Documentation Library
6.1 About Fragments
A fragment is a self-contained snippet of HTML or script including client-side JavaScript and server-side Idoc that may have value in being reused in more than one template on a web site. A fragment may contain references to other files, too, with tags like IMG SRC=xxx, SCRIPT SRC=xxx, and docLoadResourcexxx . Externally referenced files or resources serve as a fragment asset and therefore need to be made available whenever the fragment is used. Simple fragments may contain atomic content that can be inserted anywhere in a template. More complex fragments require some content to be placed in the head of the page and other content to be placed in the body. In the body, content may be placed at the top of the page, the bottom of the page, or at the cursors current position. A fragment, therefore, may contain multiple fragment snippets. While it is possible to include multiple body snippets with a head snippet, this is discouraged. Primarily because fragments that use the head of a page cannot be placed in a region template or a subtemplate. This is because neither region templates nor subtemplates are full HTML pages, and do not contain a head. Fragments should be created using just the body to best fit with the flexible nature of Site Studio architecture. Using just a body would allow the fragment to be used on page templates, subtemplates, and region templates. A page template does contain a head, and fragments can have both a head and body when used in a fragment. However, these fragments will create an ssinfo XML data island. For more information, see Section 6.8, Fragment Instance Structure in the ssinfo XML Data Island. 6-2 Oracle Fusion Middleware Technical Reference Guide for Site Studio The designer may want a fragment to take on a different look and feel or behavior depending on where it is used on the web site. This functionality is made available by the use of fragment parameters. With fragment parameters, the creator of a fragment can specify certain variable parameters, and the site designer can choose from these parameters when the fragment is actually added to a template. From a high level, fragments contain: ■ Zero or more fragment parameter definitions name, type, default value that are referenced in the fragment snippets but declared uniquely on each page that includes the fragment instance. ■ One or more fragment snippets, which are pieces of HTML or script along with an identifier to indicate where that content should be placed when the fragment is added to a template. ■ Zero or more fragment assets, which are the local files referenced by a fragment that will be made available to the fragment when it is used on a web page. It is common for a fragment to consist of two snippets. The first, usually found in the head of the page, may reference a CSS file, which will format the page, or a JavaScript file, which will provide some or all of the fragments implementation. The second, usually found in the body of the page at the drop-point, contains the presentation for the fragment. It may be as simple as a JavaScript call of a method provided by the included .js file, or it may contain a collection of HTML, JavaScript, and Idoc Script.6.2 Fragment Libraries
Parts
» Oracle Fusion Middleware Online Documentation Library
» About the Site Studio Technical Reference Scope of the Technical Reference About Site Assets
» Page Templates Subtemplates Templates
» Relationship Between Templates and Definitions Serving Web Pages
» xWebsiteSection xWebsites Metadata Fields
» xDontShowInListsForWebsites xRegionDefinition Metadata Fields
» Conversions Definitions About Metadata About Link Formats Using Path-Based Links
» wcmUrl Using Server-Side Script Links
» ssLink ssNodeLink ssWebLayoutUrl Using Server-Side Script Links
» ssLINK ssNODELINK Using Token Links
» sitenavigation.js Runtime Auto-Generated Files
» sitenavigationfunctions.js sitenavigation.xml
» Using JavaScript Links About Runtime Generated Files wcm.toggle.js
» About Fragments Oracle Fusion Middleware Online Documentation Library
» Fragment Libraries Oracle Fusion Middleware Online Documentation Library
» Read-Only Fragment Libraries Fragment Inclusion Using wcmFragment
» Client-Side JavaScript Server-Side Idoc Script
» fragments fragment parameter The Fragment Definition File
» snippet designview element The Fragment Definition File
» Fragment Snippets and the ssIncludeXml Fragment Instance Structure in the ssinfo XML Data Island
» About Native Documents wcmDynamicConversion Document Conversion in the Properties Pane
» Loading the Element API Element API Dependent Scripts
» Communication from a Contributor Form to a Custom Element
» Detecting Legacy Custom Element Forms Upgrading Legacy Custom Elements
» wcmElement wcmListStart wcmListEnd wcmListElement
» wcmUrl ssIncludeXml Oracle Fusion Middleware Online Documentation Library
» ssGetDocInfo ssGetXmlNodeCount ssIncDynamicConversion ssIncDynamicConversionByRule
» ssRandom ssGetNodeProperty ssGetWebsiteNodeType ssGetCoreMajorVersion
» ssSplitString ssGetWebsiteName ssGetSiteProperty ssGetFirstNodeId ssGetRelativeNodeId
» ssLoadSiteNavResultSet ssGetServerRelativeUrl ssGetServerRelativePath ssGetUrlPageName
» ssGetNodeLabel ssGetNodeLabelPath ssGetAllSites ssLink ssNodeLink
» ssWeblayoutUrl About Idoc Script Variables HttpWebsitesRoot HttpRelativeWebsitesRoot
» Services Related to Designer
» SS_ADD_NODE SS_ADD_WEBSITE_ID SS_BATCH_DECODE_LINK SS_CHECKIN_FRAGMENT_LIBRARY
» SS_COMMIT_SITE_CHANGES SS_CREATE_NEW_SITE_EX2 SS_CREATE_SITE_NAV_JS
» SS_DECODE_LINK SS_DELETE_NODE SS_DOC_INFO_LATEST SS_EDIT_NATIVE_DOCUMENT
» SS_GET_DOCUMENT_USAGE SS_GET_ENVIRONMENT_PROPERTY_NAMES SS_GET_FIRST_NODE_ID SS_GET_FRIENDLY_URL
» TARGET SECTION SOURCE SS_GET_PAGE
» SS_GET_NODE_LINK SS_GET_NODE_PROPERTY SS_GET_PLACEHOLDER_SWITCH_CONTENT_CONFIG
» SS_GET_SITE_AS_XML_EX2 SS_GET_SITE_ASSET_CATEGORIES SS_GET_SITE_CHANGE_MONITOR_TOKEN
» SS_PREPARE_PREVIEW SS_PUBLISH_THIS_PAGE SS_REMOVE_WEBSITE_ID SS_SET_ALL_CUSTOM_NODE_PROP_DEFS
» SS_SET_ELEMENT_DATA SS_SET_ENVIRONMENT_PROPERTY_NAMES SS_SET_NODE_PROPERTY SS_SET_NODES_PROPERTIES
» SS_SWITCH_REGION_ASSOCIATION SS_VALIDATE_WEBSITE_OBJECT WCM_PLACEHOLDER
» WCM_EDIT_DATA_FILE WCM_BEGIN_EDIT_SESSION
» Optimization Requirements The Build Process
» Installing the Contributor Console Window Launching the Contributor Console Window
» Contributor Console Window Context Ensuring the Contributor Console Window is Root
» Logging Syntax Time Profiling
» Command Window Helper Functions Keyboard Commands About the Manager Settings File ssm:settings Tag
» ssm:general Tag ssm:addSection Tag
» ssm:primaryLayout Tag ssm:secondaryLayout Tag
Show more