BASICS

ADMINISTRATION

DEVELOPMENT

SUPER ADMIN

  LAST UPDATED
5/22/2013

Configuring Page Parameters

The PCF now created includes the main body area, but the original file included side navigation and student quotes. These pieces are missing because the XSL is looking for a page parameter that does not exist. Since the parameter does not exist, the XSL is defaulting to a one column layout.

Additionally, there is no current way to edit the meta data, including title, keywords, and description. These fields should be added to the PCF in order to keep them editable on a page-by-page basis. This is done by adding the content to the PCF and then identifying what is editable by users by wrapping it in properties tags.

In order to effectively complete this task, it is necessary to know what is in the XSL. For this exercise, the available properties will be defined in this document.

1.  Page Type: Defines the type of page for the XSL transformation. This particular parameter will not be included in the Page Properties.

2.  Student Quotes: Defines whether or not the student quotes display on the left-hand side.

3.  Keywords: Defines a list of keywords that can be selected.

In addition to these parameters, meta data for the title, description, and author will be added.

Keep in mind that adding the additional parameters, specifically the page type selector, and then changing the page type will affect the in-context editing that was done earlier as that was based on a one column layout. Ultimately additional CSS files, background images, and editor tags should be created, which results in a different page template for each layout. Keep in mind, that using the <ouc:div> tags discussed later allows for using one page template with dynamic CSS that is based on the page type selection. This requires additional XSL formatting.

Configuring the Page Parameters

After determining which page parameters need to be added to the page, complete the task by adding the following code after the opening <document> tag.

<config>
      <parameter name="pagetype" type="select" group="Everyone" prompt="Page Type" alt="Please choose appropriate page type.">
            <option value="article" selected="false">Article</option>
            <option value="content" selected="false">Content</option>
            <option value="onecolumn" selected="true">One Column</option>
      </parameter>
      <parameter name="quotes" type="select" group="Everyone" prompt="Student Quotes" alt="Do you want to display the student quotes?">
            <option value="true" selected="true">Yes</option>
            <option value="false" selected="false">No</option>
      </parameter>
      <parameter name="keywords" prompt="Keywords" type="checkbox" alt="Select the appropriate keywords for the page.">
            <option value="Gallena" selected="true">Gallena</option>
            <option value="GU" selected="true">GU</option>
            <option value="Gallena University" selected="false">Gallena University</option>
            <option value="Why Choose Gallena" selected="true">Why Choose Gallena</option>
            <option value="Undergraduate" selected="true">Undergraduate</option>
            <option value="Graduate" selected="false">Graduate</option>
      </parameter>
</config>

The <config> tags encompass the <parameter> tags and are used in the XPath within the XSL.

The first parameter defines the page type. It includes the following:

1.  Name: The name of the parameter, which is used in the XPath in the XSL to determine the layout.

2.  Type: The type of parameter. This can be text, select (drop-down), radio, checkbox, or a filechooser.

3.  Group: The group of users who can edit this parameter when the parameter is wrapped in a properties tag.

4.  Prompt: The friendly label that is displayed when the parameter is wrapped in a properties tag.

5.  Alt: The instructional text for the field that will be displayed when the parameter is wrapped in a properties tag.

Between the opening and closing <parameter> tags, there are the available options.

For the <option> tags, two main attributes are needed. A friendly name is displayed between the opening and closing <option> tags.

Attribute Name

Syntax Example

Description

value

value="true | false"

Defines the value defined in the XPath within the XSL.

selected

selected="true | false"

Defines whether the defined value is the selected value for the PCF.

These settings are repeated with different values for the parameters defining whether or not the student quotes should be displayed, and which keywords are to be applied to the page.

Source Code for Student Quotes

 

Adding the Meta Data

Following the closing </config> but before the opening <content> tag, add the following in order to configure the meta tags.

<metadata>
      <meta name="Description" content="This is the meta description for creating a new page." />
      <meta name="Author" content="ME" />
</metadata>
 
<title>Create a New Page</title>

The <metadata> node encompasses the <meta> tags because it is part of the XPath that will copy all of the meta information into the head code. The <title> node will be used in the head code as well. Both sets of data can now be edited on a page-by-page basis, however.

Metadata for a New Page in the Source Code

 

Creating Page Properties

To identify parameters, the meta data, and the title for display in the Page Properties screen, the content need to be wrapped in properties tags. Before the opening <config> tag, add the following:

<!-- ouc:properties -->

This identifies where the page properties start.

Close the identified page properties using a closing tag right below the closing </title> tag.

<!-- /ouc:properties -->

It is possible to have multiple sets of properties tags if there are certain parameters and other data that should not be included in the page properties in between.

Properties Tag in Source Code

 

Save all the changes, and click on the Props icon to confirm the page properties display as expected.

Page Properties

To see how the page type parameter changes the layout of the page:

1.  From the Page Type dropdown select “Content.”

2.  Save the changes.

3.  View how the preview changed.

4.  View the source of the page, and observe that the parameter code for the Page Type parameter has changed.

<parameter name="pagetype" type="select" group="Everyone" prompt="Page Type" alt="Please choose appropriate page type.">
<option value="article" selected="false">Article</option>
      <option value="content" selected="true">Content</option>
      <option value="onecolumn" selected="false">One Column</option>
</parameter>

The preview of the page now displays the side navigation, search, and student quotes, which are defined by the XSL and page type configuration, along with the Student Quotes parameter.

Page Preview

 


Was this page helpful?

Additional Comments:


(Include your email address if you would like a reply)