Oracle® Universal Content Management 10g Release 4 (10.1.4) |
Contents |
Index |
Previous |
Next |
Site Studio Designer Guide > Working With Fragments > Using the Fragment Editor > Adding, Editing, and Deleti...
Parameters are a set of attributes that govern the appearance and behavior of a fragment when it is added to a template. When a fragment contains parameters, you are prompted to enter information in the Fragment Parameter Values dialog before adding the fragment to a template. Parameters can be used to add such things as text, color, size, or a query in the content server. And you can change the value of the parameters each time you add the fragment to a template.
While parameters are optional when building a fragment, they are very useful to make a fragment customizable and reusable. You can add most of a fragment's functionality to the source of the fragment, or you can add it as a parameter that can be changed when the fragment is actually used.
When parameters are used, you can have several renditions of the same fragment on the same template, where different parameters are used in each instance. Moreover, parameters can be useful for developers who have written code for the Web site and would like to hand off that code as a packaged feature (a customizable fragment) to a site designer. (This scenario assumes there are multiple users in Designer.)
To edit the parameter in a fragment, perform these tasks:
With the fragment open in the Fragment Editor, click Parameters.
In the Fragment Parameters dialog (see Properties for Fragment Dialog), select a parameter in the Name list.
Make the appropriate changes to the Type, Description, Default Value, Query Text, and Option List (Query Text and Option List don't apply to all parameter types). See Properties for Fragment Dialog.
Click the Parameter Up icon (Figure) or the Parameter Down icon (Figure) to move the parameter up or down in the list (this also affects its location in the Fragment Parameter Values dialog).
Click OK to close the Fragment Parameters dialog.
To see a description of the parameters in the sample fragments, see Sample Fragments.
To add a parameter to a fragment, perform these tasks:
With the fragment open in the Fragment Editor, click Parameters.
In the Fragment Parameters dialog (see Properties for Fragment Dialog), click the New Parameter icon (Figure) and type a name for the parameter in the text box provided.
Choose a type from the Type menu (for a description of each type, see Fragment Parameters Dialog).
Enter a description in the Description field.
The description displays at the bottom of the Fragment Parameter Values dialog when you use the fragment.
Enter a value for the Default Value.
This value is used if you do not choose a parameter value (in the Fragment Parameter Values dialog) when adding the fragment to a template.
Enter a value for Query Text and Option List (this applies only to parameters of type "text," "manageddoc," and "managedurl").
Click the Parameter Up icon (Figure) or the Parameter Down icon (Figure) to move the parameter up or down in the list (this also affects its location in the Fragment Parameter Values dialog).
Click OK to close the Fragment Parameters dialog.
After you create one or more parameters in the Fragment Parameters dialog, you can insert those parameters into the individual snippets in the fragment (for more in snippets, see Adding, Editing, and Deleting Fragment Snippets).
The Fragment Editor includes a convenient option to insert parameters and parameter declarations directly into your snippet code. To insert them, simply place your cursor in the code where you would like to add the parameter or parameter declaration, right-click, and then choose the appropriate action.
A good way to learn how to create and use parameters is to open a sample fragment from the Toolbox and see how its parameters are used. For a description of these fragments and their parameters, see Sample Fragments.