The Metadata Plugin
Metadata Management for Manila
 
Site last updated
2/24/2006; 12:33:21 PM
 
Home

Why

Features

FAQ

Updates

Documentation

Download

Developers

Bugs

Feedback

Discuss

Planned
Features

 
 

Showing Metadata in a Page - the showVal() Macro

Author:   John VanDyk  
Posted: 6/21/2000; 4:17:16 PM
Topic: Showing Metadata in a Page - the showVal() Macro
Msg #: 79 (top msg in thread)
Prev/Next: 78/80
Reads: 16323

The showval() macro allows you to display a metadata field in your page.

Syntax:

showval (metaname,linkTitle:nil,msgNum:"",attributes:nil)

For example, if you have a meta type named "description" defined, you could put the contents of this field into your web page like this:

{metaDataMacros.showval("description")}

If the contents of the field are a URL, this macro will make the link clickable.

If the contents of the field are a URL and you want to use something other than the link itself as the link title, pass a second parameter:

{metaDataMacros.showval("helpURL","Click here for context-sensitive help!")}

If you want to specify additional attributes for the link, use the attributes parameter:

{metaDataMacros.showval("helpURL","Click here for context-sensitive help!",attributes:"target=_blank")}

If the contents of the field are an e-mail address, it will be automatically linked with a mailto: tag. If you don't want this to happen, pass the parameter expandEmailAddresses:"false".

If you want to specify the msgNum instead of using the msgNum of the page being displayed, you can pass that as a parameter:

{metaDataMacros.showval("helpURL","Click here for context-sensitive help!",msgNum:"18")}

You can add a simple page counter to your page (or template) by using the showVal macro to display the ctReads built-in meta type:

{metaDataMacros.showval("ctReads")}

Note that adding meta tags to the HEAD element of your page is not something that the showVal macro does. In order to do this, make sure that Include in HEAD is selected for this meta type on the Managing Meta Types page. If you are using a custom template, you'll have to make sure that the {meta} macro is included in the template where you want the meta tags to appear.

You can also use the showval macro to display information about the author of the page. The following examples show the author's name:

The author of this page is {metaDataMacros.showval("{membername}")}

Here's the result of that macro for this page:
The author of this page is John VanDyk

For privacy reasons, the only information available from the personalInfo table is name. However, if you are running an intranet or have another reason to turn off the privacy filter, you can do so by commenting out a line in the metaDataMacros.showval code. The line to comment out is noted in the code.


There are responses to this message:


This page last updated Wednesday, June 12, 2002 at 9:40:41 AM. (16323)