Creating content sources
You can create, edit, apply sorts, or include custom SQL statements in content sources using a variety of tools in GoLive.
To create a content source using the Objects palette: - Drag the Content Source icon from the Dynamic Objects set of the Objects palette to the head section pane of your document window.
If the head section pane is not open, drag the Content Source icon to the small triangle directly below the Layout tab; when the head section pane opens, drop in the icon. - In the Inspector, type a name for the content source in the Description text box.
- Choose the appropriate content source type from the Type pull-down menu. Depending on the type you chose, other options appear.
To create a content source using the Content Source Editor: - Click the Open Content Source Editor button above the main area of the document window.
- Click the Create New Content Source button in the Content Source Editor.
- In the Inspector, type a name for the content source in the Description text box.
- Choose the appropriate content source type from the Type pull-down menu. Depending on the type you chose, other options appear.
To view or edit a content source: - Open a page with a content source.
- Click the Open Content Source Editor button above the main area of the document window.
- Select the desired content source.
- In the Content Source Editor, click the View Content Source button.
To delete a content source: - Open a page with a content source.
- Click the Open Content Source Editor button above the main area of the document window.
- Select the desired content source.
- In the Content Source Editor, click the Delete Content Source button.
To apply a filter to an SQL database content source: - Select a content source in the head section of the page or Content Sources Editor. You can open the Content Sources window by clicking the Open Content Source Editor icon at the top right of the page.
- Select a field in the Filter Records area of the Content Inspector.
- From the Filter Records pop-up menu, select a filter.
Filters within content sources let you refine which records from the specified database table you wish to include in the content source. The filters include (replace x with the value you wish to match): - Match request parameter x to include only records where the field value is equal to the specified request parameter value. A request parameter is a URL query parameter or a form field value from a form post.
- Match cookie x to include only records where the field value is equal to the specified cookie parameter value.
- Match session variable x to include only records where the field value is equal to the specified session parameter variable.
- Match application variable x to include only records where the field value is equal to the specified application parameter variable.
To apply a sort to an SQL database content source: - Select a content source in the head section of the page or Content Sources Editor. You can open the content sources window by clicking on the Open Content Source Editor icon at the top right of the page.
- In the Inspector, select a field from the Sort by pop-up menu to sort the database table by that field.
Note: Content source sorts are in ascending order by default. Select the Descending sort option in the Content Source Inspector to reverse the sort order.
To enter custom SQL statements in an SQL database content source: - Select a content source in the head section of the page or Content Sources Editor. You can open the content sources window by clicking the Open Content Source Editor icon at the top right of the page.
- Choose Custom SQL in the Content Source Inspector from the Table pop-up menu.
- Enter an SQL query statement in the SQL text box.
Custom SQL statements let you build your own query from the ground up, with custom selections and sorts. Use care when entering custom SQL. Errors in the SQL can result in difficult-to- diagnose errors when serving the page.
To add a Block Navigation content source to a page: - Drag a Content Source object from the Dynamic Content set of the Objects palette into the head section of the page.
- In the Inspector, set the name of the content source in the Description text box.
- Set the type of the content source to Navigation Block View.
- Set the Content Source field in the Navigation Block to name the content source that returns the full record set.
Note: Block Navigation content sources help you provide links to any page of a multi-page record display. (See Understanding block navigation.) The content source that the Navigation Block content source refers to must appear earlier in the head section than the Navigation Block content source itself. You can reorder the content sources in the head section by dragging them to the left or right within the head section of the document.
|