Main web. These preferences overwrite the site-level preferences in System.Default Preferences and Main.Site Preferences, and can be overwritten by user preferences (your personal topic, eg: WikiGuest in the Main web). full list of defaults with explanation.
- Web settings:
- Default template for new topics for this web:
- Comma separated list of forms that can be attached to topics in this web. See DataForms for more information.
- Set WEBFORMS = User Form
- Users or groups who are not / are allowed to view / change / rename topics in the Main web: (See AccessControl). Remove the # to enable any of these settings. Remember that an empty setting is a valid setting; setting DENYWEBVIEW to nothing means that anyone can view the web.
- Set DENYWEBVIEW =
- Set ALLOWWEBVIEW =
- Set DENYWEBCHANGE =
- Set ALLOWWEBCHANGE =
- Set DENYWEBRENAME =
- Set ALLOWWEBRENAME =
- Users or groups allowed to change or rename this WebPreferences topic: (e.g., AdminGroup)
- Web preferences that are not allowed to be overridden by sub-web, user or topic preferences:
- Set FINALPREFERENCES = NOSEARCHALL, ATTACHFILESIZELIMIT, WIKIWEBMASTER, WEBCOPYRIGHT, WEBTOPICLIST, DENYWEBVIEW, ALLOWWEBVIEW, DENYWEBCHANGE, ALLOWWEBCHANGE, DENYWEBRENAME, ALLOWWEBRENAME
- A preference setting lets you define a simple macro that can be expanded in your output. Preference settings do not accept any parameters.
- A preference setting looks like this:
3 or 6 spaces * Set NAME = value
* Set WEBBGCOLOR = #FFFFC0
- A preferences setting can be disabled with a # sign. Remove the # sign to enable a local customisation. Example:
* #Set DENYWEBCHANGE = %USERSWEB%.UnknownUser
- Macros defined using preference settings are expanded by enclosing the name in percent signs. Example:
- When you write
%WEBBGCOLOR%, it gets expanded to
- When you write
- You can introduce your own preference settings and use them in your topics and templates.
- A preference settings is always taken from the most current topic revision, even when accessing previous revisions of a topic.
- Preferences can be defined in a number of places:
If you are setting a preference and using it in the same topic, note that Foswiki reads all the preference settings from the saved version of the topic before it displays anything. This means you can use a macro anywhere in the topic, even if you set it somewhere inconspicuous near the end. But beware: it also means that if you change the setting of a macro you are using in the same topic,
Setstatements which occur at higher-numbered locations override settings of the same name at lower numbered levels, unless the macro was listed in a FINALPREFERENCES setting (finalised) at a lower-numbered level. In this case, the macro is locked to the value at that level;
Setstatements at higher-numbered levels are ignored.
Previewwill show the wrong thing, and you must
Savethe topic to see it correctly. Also note that Foswiki always reads the setting from the most current topic revision, so viewing older revisions of a topic can show unexpected results. The syntax for setting macros is the same anywhere:
[multiple of 3 spaces] * [space] Set [space] MACRONAME [space] = [space] valueExamples:
* Set MACRONAME = value * Set MACRONAME = valueSpaces between the = sign and the value will be ignored. You can split a value over several lines by indenting following lines with spaces - as long as you don't try to use * as the first character on the following line. Example:
* Set MACRONAME = value starts here and continues hereWhatever you include in your Macro will be expanded on display, exactly as if it had been entered directly. Example: Create a custom logo macro
- To place a logo anywhere in a web by typing
%MYLOGO%, define the preference settings on the web's Web Preferences topic, and upload a logo file, ex:
mylogo.gif. You can upload by attaching the file to Web Preferences, or, to avoid clutter, to any other topic in the same web, e.g.
LogoTopic. Sample preference setting in Web Preferences:
* Set MYLOGO = %PUBURL%/%WEB%/LogoTopic/mylogo.gifYou can also set preference settings in a topic by clicking the link
Edit topic preference settingsunder
More topic actions. Preferences set in this manner are known as 'meta' preferences and are not visible in the topic text, but take effect nevertheless. Access Control explains these security settings in detail.
Localin place of
Setin the macro definition. For example, if the user sets the following in their home topic:
* Set EDITBOXHEIGHT = 10 * Local EDITBOXHEIGHT = 20Then, when they are editing any other topic, they will get a 10 high edit box. However, when they are editing their home topic they will get a 20 high edit box.
Localcan be used wherever a preference needs to take a different value depending on where the current operation is being performed. Use this powerful feature with great care!
%ALLVARIABLES%can be used to get a listing of the values of all macros in their evaluation order, so you can see macro scope if you get confused.
- System.Default Preferences, Main.Site Preferences - site-level preferences
- WikiUsers - list of user topics. User topics can have optional user preferences
- Macros - what macros are and how to use them, including a list of common macros
- AccessControl - explains how to restrict access by users or groups