Free-Conversant Support / Inserting One Message Into Another
 Home   About Conversant   Free Sites   Hosting   Support   XML-RPC 

Search



Documentation >> Outline of How-To Docs >> Inserting One Message Into Another

insertMsg Macro

It's very simple to insert the content of a message into a page or a template in your Conversant site. All you need is the number of the message, and a simple macro.

<!--#insertMsg(N)-->

N is the number of the message that you want to insert. This macro can be used in your site's template, or in the body of another message.

It's important to keep in mind that the message isn't actually embedded until the page is being sent to the browser from the server (that is, when the message is renderered). That means that if you change the content of a message that's been inserted into other pages, it will change everywhere that it's been used.

There are an unlimited number of uses for this, esecially when building a website with Conversant... it's always useful to be able to have "template snippets" that can be embedded anywhere.

Here's an example. Let's insert the content of our navigation bar, message 2, into this message. We'll put it in an ugly yellow table. Here's the HTML source for this:

<TABLE BGCOLOR='yellow'>
	<TR><TD><!--#insertMsg(2)--></TD></TR>
</TABLE>

... and here's what the above HTML actually produces:

Message Center

New Message
Search


Documentation

Simple Macros
Message Macros
Conditional Macros

Message Labels

Special Page Types
  A.Q.P.
  Event Calendar
  Directory Mirror
  D.G. Calendar
  D.G. Topics
  Full Thread
  Query Page
  Redirect
  Weblogs
    Features
    Set Up
    Usage
    Email
  Weblog View

"How-To" Docs
  Conversant Email
  Insert Messages
  News / NNTP
  Publish a Page
  .js Syndication
  Edit Templates
  Msg. Templates
  Site Privacy

XML-RPC

This effect is recursive. That means that if the message you're inserting has another insertMsg() macro in it, it will also be evaluated. This is a very powerful feature... get comfortable with it, and you can have a very dynamic website!

Just to drive the point home: any time the navbar message is changed (message 2 on this site), the content of this page will appear to change also.

At this time, this feature works only with the website versions of the messages. We'll be incorporating it into the other interfaces in the future, though.

View in DG


This site managed with Conversant, © Copyright 2007 Macrobyte Resources