Information for new users

Useful pages

Restricting text

Blocks of restricted text can be created using %IF macros. Note that the text in double quotes in these examples can be more than one line long; just be sure to escape any double quotes inside.

Only logged-in users

%IF{
  "$USERNAME != 'guest'"
  then="Text to show to logged-in users"
  else="Optional text to show everyone else"
}%

Note that you can also restrict access with access control settings. This is simpler, may be more robust, and offers the ability to do things like only restrict editing. However, this only works for entire pages, only works users and groups (not IP addresses). For example, to block guests from viewing a topic, you could use:

   * Set DENYTOPICVIEW = Main.Guest

Guests who try to view the topic will be redirected to the login page. Normally you would place this at the bottom of the topic. If you want to hide it from casual viewers, enclose it in a comment like so:

<!--
 * Set DENYTOPICVIEW = Main.Guest
-->

Only administrators

%IF{
  "$USERNAME ingroup 'AdminGroup'"
  then="Text to show administrators"
  else="Optional text to show everyone else"
}%

Note that you can also restrict access with access control settings. This is simpler, may be more robust, and offers the ability to do things like only restrict editing. However, this only works for entire pages, only works users and groups (not IP addresses), and doesn't let you show alternate text. For example, to block guests from viewing a page, you could use:

   * Set ALLOWTOPICVIEW = Main.AdminGroup

Normally you would place this at the bottom of the topic. If you want to hide it from casual viewers, enclose it in a comment like so:
<!--
 * Set ALLOWTOPICVIEW = Main.AdminGroup
-->

Only people on campus (or on the campus VPN)

%IF{ "$Campus_IP = 'true'"
  then="Text to show people on campus"
  else="Optional text to show everyone else"
}%

(Admin note: This variable is set on the WebPreferences page. View or edit wiki text to see it.)