The mgiGuestbook Tag

Tag Behavior

The mgiGuestbook tag displays form submissions at a designated location on a target page.


Tag Syntax

The mgiGuestbook tag has a beginning tag with one required parameter and one optional parameter, a body, and an ending tag. The tag form is:

<mgiGuestbook fileLocation="File Path" write="Yes/No">
MGI tags and text
</mgiGuestbook>

The form of the guestbook insertion marker is:

<!-- Guestbook Insertion Marker -->

Required Parameters:

  • fileLocation="File Path" where "File Path" is the relative path to the target file where each guestbook entry will be written.

Optional Parameters:

  • write="Yes/No" where "Yes" indicates that the guestbook entry is written to a file and where "No" indicates that the guestbook entry is not written to a file. The default is "Yes". This parameter can be used in conjunction with variables, conditional comparisons, and embedded tags to determine whether a guestbook entry is written.

Guestbook Insertion Marker:

  • Guestbook Insertion Marker: The guestbook insertion marker is placed in the target file at the location where each guestbook entry should be written. Guestbook entries are written at the beginning of the insertion marker such that the most recent entries appear at the top of the list.


Example Usage and Output

<mgiGuestbook fileLocation="GuestbookLog.html">
<table width="450" border="1" cellspacing="0" cellpadding="0">
<tr>
<td>On <I><mgidate>,</I>
<P><mgiFieldContent name="name"> wrote to us and said:</P>
<P><font color="#5E5E5E"><mgiFieldReplace name="comments">
</font></P>
<P><mgiFieldContent name="name"> can be reached at 
<B><mgiFieldContent name="email"></B>
</td></tr>
</table>
</mgiGuestbook>

In this example, guestbook entries are written to the GuestbookLog.html file and each entry will appear in the following format at the location of the guestbook insertion marker:

On Sun, 11 March, 2001, John Doe wrote to us and said:

I really like your guestbook.

John Doe can be reached at doe@someplace.com

When the next entry is submitted, it will appear above the previous entry such as:

On Sun, 11 March, 2001, Sarah Smith wrote to us and said:

I think your guestbook is great too!

Sarah Smith can be reached at ssmith@domain.com

On Sun, 11 March, 2001, John Doe wrote to us and said:

I really like your guestbook.

John Doe can be reached at doe@someplace.com


Suggested Usage

  • Guestbook


[Return to the Referencing MGI Menu]


[User Guide Main Menu] [Understanding MGI Menu] [Using MGI Menu] [Referencing MGI Menu]