This section describes how to create, edit, and delete templates. There are also procedures for changing a template’s status.
You can also create templates on the fly when you create
and edit aggregated portlets. Do not create templates in this way
when you create secure portlets—you may receive a JavaScript
error. See Chapter 4, “Building Portlets,” for
details.
Creating a template
Select Build | Templates from the Web Studio left pane.
Click New on the Template Manager toolbar to launch the Template Upload window.
Complete these fields:
Name – enter a name for the new template. For example, you might want to name a template “2-4 Basic” for a portlet with two columns and four elements.
Roles – assign the appropriate roles to the template. When you assign a role to a template, all users assigned that role can access the template in Web Studio.
Once you add a portlet to a page, the roles assigned
to the page and portlets supersede the roles assigned to the underlying
template. A template’s roles pertain only to which roles
can access templates in Web Studio.
Type – select from HTML, HELP, JSP, or XSL.
Status – select the template’s status. You can only add portlets and elements to approved templates.
Code – enter the code that defines this template. Templates are stripped of header tags, so include only the content that normally resides between the opening and closing <BODY> tags.
If this is an HTML or HELP template, click Preview to see the template preview in a separate window.
Click Save to save the new template definition.
Click Close to exit the window.
Editing a template
In the Template Manager, select the status of the template you want to modify.
Double-click the template listing in the detail view to open the Template Editor window.
Change the Status, Type, Assigned Roles, or Code, and activate or deactivate the template.
When you are satisfied with your changes, click Preview to review your modifications if this is an HTML or HELP template.
Click Save to save your changes under the same name, or click Save As to save the template under a different same.
Click Close to exit the Template Editor.
Changing workflow status
If you are using the Web Studio’s workflow feature, you can change a template’s approval status as it moves through the workflow process.
Right-click a template in the Template Manager’s detail view, select Approval Status from the pop-up Template Menu, then select the appropriate status; or
Select a template in the Template Manager’s detail view, click Edit on the toolbar, select a new status from the Status drop-down list in the Template Editor window, then click Save.
Changing a template’s active status
You cannot add a portlet to a template unless the template is approved and active.
Right-click a template in the Template Manager’s detail view, select Active Status from the pop-up Template Menu, then select the appropriate status; or
Select a template in the Template Manager’s detail view, click Edit on the toolbar, select or deselect Active, then click Save.
Deleting a template
When you delete a template, it remains in the database, and displays in the detail view with a status of “Deleted.” To mark a template as deleted:
Right-click a template in the Template Manager’s detail view, select Approval Status from the pop-up Template Menu, then select Deleted; or
Select a template in the Template Manager’s detail view, click Edit on the toolbar, select Deleted from the Status drop-down list box in the Template Editor window, then click Save.
To change a template’s deleted status, select Deleted from the Template Manager’s Status menu, right-click the template in the detail view, select Approval Status, then select a new status.
Copyright © 2004. Sybase Inc. All rights reserved. |
![]() |