Free-Conversant Support / Nesting Conditional Macros
 Home   About Conversant   Free Sites   Hosting   Support   XML-RPC 

Search



Documentation >> Conditionals >> Advanced Features >> Nesting Conditional Macros

Nesting Conditional Macros

Nesting is a very simple idea - it's simply embedding one conditional macro "block" inside another one, so that more than one condition must be "passed" in order for the contents of the inner conditional to be included in the page.

Here's an example that would include the text only if the page that was requested is a "Bound Message" (a discussion group message that has been published to a traditional URL), and only if the person requesting the page is a member of the site.

<!--#if condition="requestPageType=='Bound Message'"-->

<!--#if condition="userIsMember"-->

1. This text will only be seen if you're a member and if this is a Bound Message.

<!--#else-->

2. Seeing this text means that this page is a Bound Message, but you are not a member (or aren't logged on).

<!--#endIf-->

<!--#else-->

3. You're seeing this text because this is not a bound message.

<!--#endIf-->

Here's the example above, in action:

2. Seeing this text means that this page is a Bound Message, but you are not a member (or aren't logged on).

Simple enough, right?

You can see the results in the example change by logging on or off of the site, and by switching back and forth between the Bound Message for this page in the docs, and the message in the Discussion Group.

View in DG