Take into consideration the features and functions of your site. Are you replicating functionality in a similar manner? Do you have pages, or a series of pages, that are remarkably similar, but functionally or structurally different in one or two areas? (For example, do you have a special section that creates an exception to your navigation rule or has an additional dynamic list?) These structural differences often get interpreted as a need for additional layout templates. However, adding new layout templates comes with an added cost.
When adding layout templates, keep the following in mind:
- These templates must be maintained. If your site design changes, or if there is some structural change to your web site, someone will need to modify the template
- These templates must be accounted for. This is one more file that you will need to track during the publication process
- These templates must maintain consistency, and the more files you have, the more difficult this task becomes.
Ideally, a small number of templates will serve a greater good on your website. However, companies
Fragments and parameters offer a great starting ground for allowing greater flexibility with layout templates, but they often fall short of a full solution. When you add a fragment to a layout template and assign parameter values, those values are stored on the layout template itself. For example, if you have a fragment that displays a dynamic list, and the query powering that list is assigned in a parameter, that value is saved directly on your layout template. If you were to use that layout template in another section, you would be unable to change the query without affecting the page as it appears in the original section. This severely limits the reusability and flexibility of this layout template.
Luckily, the Oracle CMS provides an alternative method of assigning that dynamic query value. The tool used for that is “Custom Section Properties.” Just like you can define and assign parameters to a specific fragment, you can define and assign properties to the sections of your web site. These properties are then available on your layout templates and in your fragments.
Let’s take closer look at the dynamic query example. Assume that your original fragment was set up in the following manner:
You have a single parameter “ssQueryText” that defines your query:

You have the following code inside your snippet:
<!--$ ssQueryText = getValue("#active", ssFragmentInstanceId & "_ssQueryText") -->
<!--$ QueryText = ssQueryText -->
<!--$ executeService("GET_SEARCH_RESULTS") -->
<!--$ loop SearchResults -->
<!--$ dDocTitle --><br />
<!--$ endloop -->
Note: Granted, this is an overly-simplistic fragment. You can certainly expand this to include styles, sorting, additional logic, etc.
If you were to put this fragment on a layout page and assign that layout page to two different sections of your web site, there would be no way to use the same fragment to display different lists. This can be extremely limiting.
Let’s take a new approach with a different fragment. Before we create the fragment though, we’ll need to set up our site to accommodate a Custom Section Property. In the top menu of Site Studio, there is a button for “Define Custom Section Properties.” Click that button to access the Custom Section Properties setup screen.

From the setup screen, click the “Add” button. This will allow you to add a custom section to the Properties pane for the sections. This process is very similar to adding a parameter to a fragment.

You’ll need to provide three values for the definition:
- Name: must be a valid XML name, so no spaces or special characters. We’ll call ours “SectionQuery”
- Type: you have a wide variety of formats from which to choose. In this case, let’s select “managedquery”
- Description: any descriptive text to help understand the property better. We’ve used “The query that is special to this sections

Once you’ve filled this out, click “OK.”

Your Custom Section Property is now defined, so just click “OK” again to return to Site Studio. Click on a section and look at the bottom of the Properties pane. You should see a new set of properties labeled “Custom section properties,” and your property should be present in the list:

Just as you can assign a different title to each section, you now have the ability to assign a different query to each section. Using your same two sections as before, enter two different queries for those sections. Notice that, because we selected “managedquery” as the variable type, Site Studio automatically assists us in creating a valid query.
Let’s take another look at the fragment and incorporate this new property into the code. Create a new fragment, but do not include a parameter. Remember, we want to get the query value from the Custom Section Property that we created. The only thing that really needs to change in this fragment is how QueryText gets assigned. In the previous example, we took it from a parameter. Here, we can leverage our Custom Section Property easily:
<!--$ QueryText = ssGetNodeProperty("SectionQuery") -->
We’re using the ssGetNodeProperty function to read the value from the Properties panel and incorporate it into our code execution. From here on out, the code is the same:
<!--$ executeService("GET_SEARCH_RESULTS") -->
<!--$ loop SearchResults -->
<!--$ dDocTitle --><br />
<!--$ endloop -->
Save your new fragment and put it on your layout page. Check your results. You should see the same layout page, but with different query results!
This feature has endless possibilities. Some common uses include:
- Changing navigation structures; perhaps some sections require 2 levels of navigation while some require three
- Adding a true/ false option to show an area of the layout page
- Assigning different style sheets to different sections
- Managing parameters for Flash objects