About Fragments Adding and Editing Fragments

13 Working With Fragments 13-1 13 Working With Fragments This section covers the following topics: ■ About Fragments on page 13-1 ■ Adding and Editing Fragments on page 13-1 ■ Fragment Handling in Templates on page 13-2 ■ Fragments in the Toolbox on page 13-2 ■ Filtering Fragments in the Toolbox on page 13-4 ■ Adding Fragments to a Template on page 13-4 ■ Previewing Fragments on page 13-5 ■ Editing Fragments on page 13-7 ■ Creating a New Fragment on page 13-9 ■ Deleting a Fragment on page 13-10 ■ Deleting a Fragment in the Toolbox on page 13-10 ■ Using the Fragment Editor on page 13-10 ■ Fragment Libraries on page 13-22

13.1 About Fragments

When you first design a page template, you generally start with the basic look and feel of the site, using background colors, graphics, text, and a table layout. This kind of information displays in the same way on every page of the Web site, or a section of the Web site. You can, therefore, add this information directly to the page template, subtemplate, or region template in source or design view. A fragment can be a single line of text such as a copyright notice, or it can be a complex collection of scripts performing client-side and server-side actions such as a JavaScript-based menu. Just about anything that you add to a page template, subtemplate, or region template can be added as a fragment. How often you use fragments depends on your preference and the requirements of your Web site.

13.2 Adding and Editing Fragments

Fragments can be added and edited using the Toolbox in Designer. Site Studio includes numerous sample fragments in the Toolbox that you can use or customize for 13-2 Oracle Fusion Middleware Users Guide for Site Studio Designer your own see Fragments in the Toolbox on page 13-2. To use a fragment, simply place your cursor on the template where you would like the fragment to appear and then click the desired fragment in the Toolbox. You can customize the way a fragment appears on a template by changing its parameters in the Fragment Parameter Values dialog, which you see when you add the fragment to a template. The fragments contain parameters so that you can customize the fragment each time you use it on a template. If theres a setting that youre unable to change in a parameter, you can always open the fragment in the Fragment Editor and customize it there; even add your own custom parameter if you like.

13.3 Fragment Handling in Templates