When Webgenz CMS finds a Macro definition, it may alter the Macro's value before it replaces the Macro reference with the
Macro value. Why would Webgenz CMS do this? Webgenz CMS does this in order to preserve the formatting of the
HTML document that it generates. Here's an example:
Consider the following Template File:
<HTML>
<HEAD>
<TITLE>My Title</TITLE>
</HEAD>
<BODY>
<TABLE>
<TR>
<TD>
[@MY_CONTENT]
</TD>
</TR>
</TABLE>
</BODY>
</HTML>
And the following Content File:
[@MY_CONTENT]:
This is a block of content that
is a few lines long. This is
just an example.
[@]
If Webgenz CMS were to simply insert the Macro value in place of the Macro reference, the result would be the following:
<HTML>
<HEAD>
<TITLE>My Title</TITLE>
</HEAD>
<BODY>
<TABLE>
<TR>
<TD>
This is a block of content that
is a few lines long. This is
just an example.
</TD>
</TR>
</TABLE>
</BODY>
</HTML>
Since the formatting of this output is undesirable, Webgenz CMS will alter the Macro value. Webgenz will add the
white space that appears before and after the Macro reference in the Template file to each line of the Macro value. In the example above, the output will be as follows:
<HTML>
<HEAD>
<TITLE>My Title</TITLE>
</HEAD>
<BODY>
<TABLE>
<TR>
<TD>
This is a block of content that
is a few lines long. This is
just an example.
</TD>
</TR>
</TABLE>
</BODY>
</HTML>
As you can see, this formatting is much more desirable and reflects the formatting that the
author of the Template File intended. Take a look at another example to see how Webgenz treats
multi-line Macro values that appear on a line with code other than white space:
<HTML>
<HEAD>
<TITLE>My Title</TITLE>
</HEAD>
<BODY>
<TABLE>
<TR>
<TD>[@MY_CONTENT]</TD>
</TR>
</TABLE>
</BODY>
</HTML>
In this case, Webgenz CMS will generate the following:
<HTML>
<HEAD>
<TITLE>My Title</TITLE>
</HEAD>
<BODY>
<TABLE>
<TR>
<TD>This is a block of content that
is a few lines long. This is
just an example.</TD>
</TR>
</TABLE>
</BODY>
</HTML>
Note: The example above applies to Webgenz CMS version 6.1.0 and higher.