|
The Metadata Plugin Metadata Management for Manila |
Site last updated 2/24/2006; 12:33:21 PM |
|
eval() Macro
Sometimes you want to build special strings using multiple meta types, and the showVal() macro just doesn't cut it. What you need is a macro to interpret your string and replace any meta types with actual values. This is what the eval() macro does.For example, maybe I want to create a mailto: url that uses the member's name as the name of the link: {metaDataMacros.eval("<a href='mailto:{member}'>{membername}</a>")} Let's try it (of course this will only work if you're a member of this site): Notice the use of single quotes rather than double quotes in the string we passed. Perfectly legal and it avoids potential Manila expansion problems. The eval() macro takes three parameters. The first one is the string you want expanded. The second is an optional msgNum, which defaults to the msgNum of the page being displayed (if the page being displayed doesn't have a msgNum and you haven't provided one the macro aborts). The third is the optional dateFormat parameter, which you're already familiar with from its use with the query macro. It's only needed if you have a meta type that is a date. Note that {member} and {membername} are case-sensitive; they must be lowercase. There are responses to this message:
|
|||||||||||||||||||
| This page last updated Thursday, November 15, 2001 at 12:34:26 PM. | (10218) |