On 2/19/05, Brian Carnell said:
>I'd really like a message macro that would let me point to the path of a
>weblog ii page, and the macro would report back a) whether that message
>is on that weblog ii page, and b) if so, what date it appears.
How about something like this:
<!--#weblog.findMessage
pageId="weblog2beta/index"
linkText="On the Weblog"
noValueText="This message is not on the weblog."
-->
Which produces: On the Weblog
That will return the full url to the message in the weblog archives,
including the #anchor. If the message isn't there, it'll return
noValueText if you provide it or an error (in html comments, of
course) if you don't.
There are other options, too.
Set linktext="anything here" if you want the result to be an HTML link
to the location on the weblog. If you don't set the linkText
attribute, then the result will be just a URL (or the result of
noValueText, or an error, as describe above).
Set dayPathOnly="true" if you want the result to just be the path to
the day in the archives, like /2005/02/18#item1234.
Set pathOnly="true" if you want hte result to just be the path within
the conversation, starting at the root of the conversation. So, you'd
get back something like "index/2005/02/18#item1234" instead of
"http://www.free-conversant.com/myfreesite/index/2005/02/18#item1234".
Set includeAnchor="false" if you don't want it to include the
#item1234 portion in the result.
Finally, if you want to link to it on a particular channel, just include
channel="theChannelName" in the macro. So the macro might look
something like this:
<!--#weblog.findMessage
pageId="weblog2beta/index"
linkText="On the Weblog"
channel="channelNameHere"
noValueText="Not on the weblog."
-->
That will, of course, check to make sure the message appears on the
channel in question before linking to it.
Got all that? :-)
Seth