Metadata Function

The metadata tag is used to display the metadata for one or more content blocks in the Ektron CMS400.NET Web site. This custom tag lets you generate the list of metadata edited by the authors and insert it in the source of the Web page. Below is an example of the metadata custom tag.

<% ecmMetaData “ItemList”,”Spare1” %>

The attributes are described below.

Attribute

Description

Required?

ItemList

List of the content block ID numbers, and exclusions See Also: ot exist. Creating an Item List and Item List

No

Spare1

Not yet implemented See Also: Spare 1

MUST BE ““

Creating an Item List

The Item List for the ecmMetadata tag has the following format.

“[content block id; Exclusion list]...[content block id; Exclusion list]”

Attribute

Description

Required?

[ (left bracket)

Delineates the beginning of a content block id/exclusion list pair

Yes

Content Block ID

The ID of the content block whose metadata you want to retrieve

Yes

; (semicolon)

Separator: Separates content block id from the exclusion list

No (Yes if including an exclusion list)

Exclusion List

A comma delimited list of metadata you do not want to be retrieved for this content block.

No

] (right bracket)

Delineates the end of a content block id/exclusion list pair

Yes

ecmMetadata Example

For this example, our administrator has defined the following metadata types for Ektron CMS400.NET.

Name

Style

Type

Editable

Required

Remove Dups

Case Sensitive

Title

n/a

HTML

Yes

Yes

No

n/a

Keywords

Name

Meta

Yes

Yes

Yes

No

Content-Type

http-equiv

Meta

No

Yes

Yes

n/a

Our example Web page has two content blocks displayed.

content block 1, the company’s home page introduction text

content block 2, a sidebar containing the lead story for the week

The metadata entered by your content editors for these two content blocks are:

Content Block 1:
Title – “Welcome to Our Home Page”
Keywords – “Home; page; company; Welcome”
Content-Type -- “text/html; charset=iso-8859-1“

Content Block 2:
Title – “Announcing our New Product!”
Keywords – “Announce; company; product; widget”
Content-Type -- “text/html; charset=iso-8859-1“

To include both content blocks’ metadata in a Web page, the ecmMetadata call looks like this.

<html>

<head>

<% ecmMetadata “[1][2;Title,Content-Type]”, “” %>

(rest of head)

</head>

<body>

(rest of web page document)

</body>

</html>

In the above example, the ecmMetadata call is contained in the <head> of the HTML document (since all HTML metadata is required to exist there). When the Web page is viewed, the Web page source contains the following information:

<html>

<head>

<Title>Welcome to Our Home Page</Title>

<meta name=”Keywords” content= Home; page; company; Welcome; Announce;

product; widget”>

<meta http-equiv=”Content-Type” content=”text/html; charset=iso-8859-1”>

(rest of head)

</head>

<body>

(rest of web page document)

</body>

</html>

The ecmMetadata constructed three HTML tags based on the administrator defined parameters and the ecmMetadata call.

The metadata tag was constructed in the page because:

[1] - Displays all metadata content for the content block ID=1. In this example, the title, keywords, and content-type were defined, so they were displayed as:

<Title>Welcome to Our Home Page</Title>

<meta name=”Keywords” content= Home; page; company; Welcome;

Announce; product; widget”>

<meta http-equiv=”Content-Type” content=”text/html;

charset=iso-8859-1”>

[2;title,content-type] - Displays all metadata content for content block ID=2, except for its title and content-type definitions.

<Title>Welcome to Our Home Page</Title>

<meta name=”Keywords” content= Home; page; company; Welcome;

Announce; product; widget”>

<meta http-equiv=”Content-Type” content=”text/html;

charset=iso-8859-1”>

The next section provides more examples.

More ecmMetadata Examples

Shown below is an example of the metadata function in an ASP Web page.

<TR>

<TD>

<% ecmMetaData "[1][2;title][14;keywords]","" %>

</TD>

</TR>

The previous example has the following properties:

All metadata for content block ID=1 is inserted into the page

All metadata for the content block ID=2 except for its title is inserted into the page

All metadata for the content block ID=14 except for its keywords is inserted into the page

Using a Dynamic Metadata Tag

You can use a metadata tag in a template to define the metadata for a specific content block. However, you can also use a dynamic metadata tag combined with a content block tag to show the metadata for all content blocks on a Web page.

This allows you to create a template and not have to keep updating the tag by adding the new ID and exclusion list. Shown below is the sample code for this.

<!-- #include virtual="/Ektron CMS400.NETsample/Ektron CMS400.NETscripts/ektronAPI.asp" -->

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">

<html>

<head>

<% Dim id

if (request.QueryString("id")<> "") then

id = request.QueryString("id")

else

id = 1

end if

ecmMetadata "[" & id & "]", ""

%>

</head>

<body>

<% ecmContentBlock(request.QueryString("id")) %>

</body>

</html>

In this example, if you specify a content block in the URL and the page is displayed, the metadata takes that ID and displays the proper metadata in the source for the content block.

ecmMetadata Attributes

Below are the attributes and their descriptions.

Item List

In this attribute of the ecmMetadata tag, you need to specify two values.

Value

Specifies

ID

The content block ID whose metadata will appear

Exclusion List

The metadata to be excluded. See Also: Creating an Item List

Some examples might be:

<% ecmMetaData "[1][2]","" %>

In this example, all metadata from content block ID=1 and 2 is displayed.

<% ecmMetaData "[1;title][2;keywords]","" %>

In this example, all the metadata from content block ID=1 will be displayed except for the title. Also, all the metadata for content block ID=2 is displayed except its keywords.

<% ecmMetaData "[1][2;title,keywords]","" %>

In this example, all metadata from content block ID=1 is displayed, and all metadata from content block ID=2 is displayed except its title and keywords.

Spare 1

One attribute field at the end is currently not used. It is for future scalability. When you insert a single metadata tag into a template, you must leave this attributes as ““.

Previous TopicNext Topic|