Difference: WebPreferences (1 vs. 14)

Revision 14
14 Feb 2013 - Main.CordSlatton
Line: 1 to 1
 
META TOPICPARENT name="WebHome"

Sites Web Preferences

Line: 20 to 19
 
    • Note: This setting is automatically configured when you create a web

  • Image, URL and alternate tooltip text of web's logo.
    Note: Don't add your own local logos to the TWikiLogos topic; create your own logos topic instead.
Changed:
<
<
    • #Set WEBLOGOIMG = /wiki/pub/Sites/WebPreferences/EMS_Full_Logo_Color_40px.png
    • #Set WEBLOGOURL = http://www.eugenemakerspace.com
    • #Set WEBLOGOALT = Eugene Maker Space
>
>
    • Set WEBLOGONAME = EMS_Full_Logo_Color_40px.png
    • Set WIKILOGOIMG = /wiki/pub/Sites/WebPreferences/EMS_Full_Logo_Color_40px.png
    • Set WIKILOGOALT = Eugene Maker Space
    • Set WIKILOGOURL = http://www.eugenemakerspace.com
 

  • List this web in the SiteMap. If you want the web listed, then set SITEMAPLIST to on, do not set NOSEARCHALL, and add the "what" and "use to..." description for the site map. Use links that include the name of the web, i.e. Sites.Topic links.
    Note: Unlike other variables, the setting of SITEMAPLIST is not inherited from parent webs. It has to be set in every web that is to be listed in the SiteMap
    • Set SITEMAPLIST = on
Line: 59 to 59
 

  • Web preferences that are not allowed to be overridden by user or topic preferences:
    • Set FINALPREFERENCES = NOSEARCHALL, ATTACHFILESIZELIMIT, WIKIWEBMASTER, WEBCOPYRIGHT, WEBTOPICLIST, DENYWEBVIEW, ALLOWWEBVIEW, DENYWEBCHANGE, ALLOWWEBCHANGE, DENYWEBRENAME, ALLOWWEBRENAME
Deleted:
<
<
 

Tools

%META:TOPICPARENT{name="AdminToolsCategory"}% #SettingPrefs

Preference Settings

A preference setting lets you define a simple macro that will be expanded in your output. A preference setting looks like this:

[multiple of 3 spaces] * [space] Set [space] MACRONAME [space] = [space] value

Example:

   * Set WEBBGCOLOR = #FFFFC0
Macros defined using preference settings are expanded by enclosing their name in percent signs. So when you write %WEBBGCOLOR%, it gets expanded to #009900

A preference macro 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:
  1. DefaultPreferences (Foswiki upgrades overwrite this topic)
  2. In (some) plugin documentation topics. (Deprecated)
  3. SitePreferences
  4. In user topics, if the user has one (yours is Main.WikiGuest)
  5. WebPreferences
  6. Sub-webs inherit the WebPreferences of their parent
  7. In the topic being accessed
In this list, Set statements which occur at numerically higher locations override macros of the same name defined 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; set statements at higher-numbered levels are ignored.

prefs-stack.jpg

Writing preference settings

Preference settings are written as a simple bullet. In TML, they are written as 3-spaces,asterisk,equals,value
   * Set MYSETTING = My setting value

When using the Wysiwyg editor, click the "Bullet" button and write the setting as a simple bullet. Don't include the asterisk.

Spaces 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 here

Whatever you include in your macro will be expanded on display, exactly as if it had been entered directly (though see Parameters, below).

Example: Create a custom logo macro
  • To place a logo anywhere in a web by typing %MYLOGO%, define the preference settings in the web's WebPreferences topic, and upload a logo file, ex: mylogo.gif. You can upload by attaching the file to WebPreferences, or, to avoid clutter, to any other topic in the same web, e.g. LogoTopic. Sample preference setting in WebPreferences:
   * Set MYLOGO = %PUBURL%/%WEB%/LogoTopic/mylogo.gif

Preference settings are case sensitive. (Foswiki by convention always writes settings in upper case.)

   * Set lower = This is LOWER
   * Set LOWER = This is UPPER
   * Set System.LoWeR = This is MIXED
Expand %lower%, %LOWER% and %LoWeR%
Expand %lower%, %LOWER% and %LoWeR%.

IDEA! preference settings can easily be disabled with a # sign. Example:
   * #Set DENYWEBCHANGE = %USERSWEB%.UnknownUser

Hiding preference settings

IDEA! You can hide preference settings in the output by enclosing them in HTML comments; for example,
<!--
   * Set HIDDEN = This will be invisible in the output
-->

You can also set preference settings in a topic by clicking the link Edit topic preference settings under 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.

ALERT! Caution If your topic will be used in an INCLUDE, it is recommended to not use HTML comments. instead, set preferences into the topic metadata by using the "Edit Settings for this topic" button on the "More topic actions" page. Settings in an included topic are always ignored, but nested comments will break the HTML.

Order of perference settings

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 setting anywhere in the topic, even if you set it at the very end. But beware: it also means that if you change the setting of a macro you are using in the same topic, Preview will show the wrong thing, and you must Save the topic to see it correctly.

Preference settings and topic revision history

Foswiki always reads the settings from the most current topic revision, so viewing older revisions of a topic can show unexpected results.

And especially important, preference settings are never overridden or set in "%INCLUDE{" topics. in the below example about weather conditions, note the difference in the CONDITIONS expansion

Parameters

<--  
-->
Note that %CONDITIONS% expands differently when this example is viewed in Macros. This is because Set statement are not active in included topics. The including topic's set statements are used.

Macros defined using preference settings can take parameters. These are symbols passed in the call to the macro to define local macros that will be expanded in the output. For example,
   * Set CONDITIONS = According to [[System.%BASETOPIC%][%BASETOPIC%]] the %WHAT% is %STATE% today (Set in ...).
You can call this macro passing in values for WHAT and STATE. For example:
  • %CONDITIONS{WHAT="sea" STATE="choppy"}%
    • expands to %CONDITIONS{WHAT="sea" STATE="choppy"}%.

Parameter defaults

  • The special parameter name DEFAULT gets the value of any unnamed parameter in the macro call.
  • Parameter macros can accept a default parameter so that they expand to something even when a value isn't passed for them in the call.
Example:
   * Set WEATHER = It's %DEFAULT{default="raining"}%.
  • %WEATHER% expands to %WEATHER%
  • %WEATHER{"sunny"}% expands to %WEATHER{"sunny"}%
The standard formatting tokens can be used in parameters. They will be expanded immediately when the macro is instantiated.

ALERT! Note that parameters override all other macros, including system defined macros, in the expansion of the macro where they are used.

Access Control Settings

These are special types of preference settings to control access to content. AccessControl explains these security settings in detail. Parameters are not available in access control settings.

Local values for preferences

Certain topics (user, plugin, web, site and default preferences topics) have a problem; macros defined in those topics can have two meanings. For example, consider a user topic. A user may want to use a double-height edit box when they are editing their home topic - but only when editing their home topic. The rest of the time, they want to have a normal edit box. This separation is achieved using Local in place of Set in the macro definition. For example, if the user sets the following in their home topic:
   * Set EDITBOXHEIGHT = 10
   * Local EDITBOXHEIGHT = 20
Then, 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. Local can 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.
<--  -->

Deprecation warning. The setting used in this example, EDITBOXHEIGHT, is being deprecated and will be remove from Foswiki 1.2. Note that if the edit box size is changed using the javascript controls in the lower right corner of the edit box window, those settings will be used, and the EDITBOX* settings will be ignored.

Related Topics

Added:
>
>
  • EMS Logo:
    EMS_Full_Logo_Color_40px.png

 
META FILEATTACHMENT attr="" autoattached="1" comment="" date="1242161154" name="logo.gif" path="logo.gif" size="2545" user="UnknownUser" version=""
Changed:
<
<
META FILEATTACHMENT attr="" autoattached="1" comment="" date="1242161154" name="favicon.ico" path="favicon.ico" size="1406" user="UnknownUser" version=""
>
>
META FILEATTACHMENT attachment="favicon.ico" attr="" comment="EMS Favicon (bug)" date="1360816986" name="favicon.ico" path="favicon.ico" size="1150" user="Cord42" version="1"
META FILEATTACHMENT attachment="EMS_Full_Logo_Color_40px.png" attr="" comment="EMS Logo" date="1360813642" name="EMS_Full_Logo_Color_40px.png" path="EMS_Full_Logo_Color_40px.png" size="10097" user="Cord42" version="1"
Revision 13
30 Jul 2010 - Main.ClifCox
Line: 1 to 1
 
META TOPICPARENT name="WebHome"

Sites Web Preferences

Line: 13 to 13
 
  • List of topics of the Sites web:
    • #Set WEBTOPICLIST = %WEBTOPICLIST%
Changed:
<
<
 #009900 
>
>
#009900
 
  • Web-specific background color: (Pick a lighter one of the StandardColors).
    • Set WEBBGCOLOR = #009900
    • Note: This setting is automatically configured when you create a web
Changed:
<
<
  • Image, URL and alternate tooltip text of web's logo.
    Note: Don't add your own local logos to the TWikiLogos topic; create your own logos topic instead.
>
>
  • Image, URL and alternate tooltip text of web's logo.
    Note: Don't add your own local logos to the TWikiLogos topic; create your own logos topic instead.
 
    • #Set WEBLOGOIMG = /wiki/pub/Sites/WebPreferences/EMS_Full_Logo_Color_40px.png
    • #Set WEBLOGOURL = http://www.eugenemakerspace.com
    • #Set WEBLOGOALT = Eugene Maker Space
Changed:
<
<
  • List this web in the SiteMap. If you want the web listed, then set SITEMAPLIST to on, do not set NOSEARCHALL, and add the "what" and "use to..." description for the site map. Use links that include the name of the web, i.e. Sites.Topic links.
    Note: Unlike other variables, the setting of SITEMAPLIST is not inherited from parent webs. It has to be set in every web that is to be listed in the SiteMap
>
>
  • List this web in the SiteMap. If you want the web listed, then set SITEMAPLIST to on, do not set NOSEARCHALL, and add the "what" and "use to..." description for the site map. Use links that include the name of the web, i.e. Sites.Topic links.
    Note: Unlike other variables, the setting of SITEMAPLIST is not inherited from parent webs. It has to be set in every web that is to be listed in the SiteMap
 
    • Set SITEMAPLIST = on
    • Set SITEMAPWHAT =
    • Set SITEMAPUSETO =
Line: 52 to 49
 
    • #Set DENYWEBVIEW =
    • #Set ALLOWWEBVIEW =
    • #Set DENYWEBCHANGE =
Changed:
<
<
>
>
    • #Set ALLOWWEBCHANGE =
 
    • #Set DENYWEBRENAME =
Changed:
<
<
>
>
    • #Set ALLOWWEBRENAME =
 

Revision 12
12 May 2009 - Main.ClifCox
Line: 1 to 1
 
META TOPICPARENT name="WebHome"

Sites Web Preferences

Line: 17 to 17
   #009900 
  • Web-specific background color: (Pick a lighter one of the StandardColors).
Changed:
<
<
    • Set WEBBGCOLOR = #DDDDDD
>
>
    • Set WEBBGCOLOR = #009900
 
    • Note: This setting is automatically configured when you create a web

  • Image, URL and alternate tooltip text of web's logo.
Line: 52 to 52
 
    • #Set DENYWEBVIEW =
    • #Set ALLOWWEBVIEW =
    • #Set DENYWEBCHANGE =
Changed:
<
<
>
>
 
    • #Set DENYWEBRENAME =
Changed:
<
<
>
>
 

  • Users or groups allowed to change or rename this WebPreferences topic: (e.g., AdminGroup)
Changed:
<
<
>
>
 

  • Web preferences that are not allowed to be overridden by user or topic preferences:
    • Set FINALPREFERENCES = NOSEARCHALL, ATTACHFILESIZELIMIT, WIKIWEBMASTER, WEBCOPYRIGHT, WEBTOPICLIST, DENYWEBVIEW, ALLOWWEBVIEW, DENYWEBCHANGE, ALLOWWEBCHANGE, DENYWEBRENAME, ALLOWWEBRENAME

Tools

%META:TOPICPARENT{name="AdminToolsCategory"}% #SettingPrefs

Preference Settings

A preference setting lets you define a simple macro that will be expanded in your output. A preference setting looks like this:

[multiple of 3 spaces] * [space] Set [space] MACRONAME [space] = [space] value

Example:

   * Set WEBBGCOLOR = #FFFFC0
Macros defined using preference settings are expanded by enclosing their name in percent signs. So when you write %WEBBGCOLOR%, it gets expanded to #009900

A preference macro 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:
  1. DefaultPreferences (Foswiki upgrades overwrite this topic)
  2. In (some) plugin documentation topics. (Deprecated)
  3. SitePreferences
  4. In user topics, if the user has one (yours is Main.WikiGuest)
  5. WebPreferences
  6. Sub-webs inherit the WebPreferences of their parent
  7. In the topic being accessed
In this list, Set statements which occur at numerically higher locations override macros of the same name defined 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; set statements at higher-numbered levels are ignored.

prefs-stack.jpg

Writing preference settings

Preference settings are written as a simple bullet. In TML, they are written as 3-spaces,asterisk,equals,value
   * Set MYSETTING = My setting value

When using the Wysiwyg editor, click the "Bullet" button and write the setting as a simple bullet. Don't include the asterisk.

Spaces 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 here

Whatever you include in your macro will be expanded on display, exactly as if it had been entered directly (though see Parameters, below).

Example: Create a custom logo macro
  • To place a logo anywhere in a web by typing %MYLOGO%, define the preference settings in the web's WebPreferences topic, and upload a logo file, ex: mylogo.gif. You can upload by attaching the file to WebPreferences, or, to avoid clutter, to any other topic in the same web, e.g. LogoTopic. Sample preference setting in WebPreferences:
   * Set MYLOGO = %PUBURL%/%WEB%/LogoTopic/mylogo.gif

Preference settings are case sensitive. (Foswiki by convention always writes settings in upper case.)

   * Set lower = This is LOWER
   * Set LOWER = This is UPPER
   * Set System.LoWeR = This is MIXED
Expand %lower%, %LOWER% and %LoWeR%
Expand %lower%, %LOWER% and %LoWeR%.

IDEA! preference settings can easily be disabled with a # sign. Example:
   * #Set DENYWEBCHANGE = %USERSWEB%.UnknownUser

Hiding preference settings

IDEA! You can hide preference settings in the output by enclosing them in HTML comments; for example,
<!--
   * Set HIDDEN = This will be invisible in the output
-->

You can also set preference settings in a topic by clicking the link Edit topic preference settings under 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.

ALERT! Caution If your topic will be used in an INCLUDE, it is recommended to not use HTML comments. instead, set preferences into the topic metadata by using the "Edit Settings for this topic" button on the "More topic actions" page. Settings in an included topic are always ignored, but nested comments will break the HTML.

Order of perference settings

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 setting anywhere in the topic, even if you set it at the very end. But beware: it also means that if you change the setting of a macro you are using in the same topic, Preview will show the wrong thing, and you must Save the topic to see it correctly.

Preference settings and topic revision history

Foswiki always reads the settings from the most current topic revision, so viewing older revisions of a topic can show unexpected results.

And especially important, preference settings are never overridden or set in "%INCLUDE{" topics. in the below example about weather conditions, note the difference in the CONDITIONS expansion

Parameters

<--  
-->
Note that %CONDITIONS% expands differently when this example is viewed in Macros. This is because Set statement are not active in included topics. The including topic's set statements are used.

Macros defined using preference settings can take parameters. These are symbols passed in the call to the macro to define local macros that will be expanded in the output. For example,
   * Set CONDITIONS = According to [[System.%BASETOPIC%][%BASETOPIC%]] the %WHAT% is %STATE% today (Set in ...).
You can call this macro passing in values for WHAT and STATE. For example:
  • %CONDITIONS{WHAT="sea" STATE="choppy"}%
    • expands to %CONDITIONS{WHAT="sea" STATE="choppy"}%.

Parameter defaults

  • The special parameter name DEFAULT gets the value of any unnamed parameter in the macro call.
  • Parameter macros can accept a default parameter so that they expand to something even when a value isn't passed for them in the call.
Example:
   * Set WEATHER = It's %DEFAULT{default="raining"}%.
  • %WEATHER% expands to %WEATHER%
  • %WEATHER{"sunny"}% expands to %WEATHER{"sunny"}%
The standard formatting tokens can be used in parameters. They will be expanded immediately when the macro is instantiated.

ALERT! Note that parameters override all other macros, including system defined macros, in the expansion of the macro where they are used.

Access Control Settings

These are special types of preference settings to control access to content. AccessControl explains these security settings in detail. Parameters are not available in access control settings.

Local values for preferences

Certain topics (user, plugin, web, site and default preferences topics) have a problem; macros defined in those topics can have two meanings. For example, consider a user topic. A user may want to use a double-height edit box when they are editing their home topic - but only when editing their home topic. The rest of the time, they want to have a normal edit box. This separation is achieved using Local in place of Set in the macro definition. For example, if the user sets the following in their home topic:
   * Set EDITBOXHEIGHT = 10
   * Local EDITBOXHEIGHT = 20
Then, 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. Local can 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.
<--  -->

Deprecation warning. The setting used in this example, EDITBOXHEIGHT, is being deprecated and will be remove from Foswiki 1.2. Note that if the edit box size is changed using the javascript controls in the lower right corner of the edit box window, those settings will be used, and the EDITBOX* settings will be ignored.

Related Topics

Changed:
<
<
META FILEATTACHMENT attachment="favicon.ico" attr="" comment="placeholder favicon" date="1100974473" name="favicon.ico" path="favicon.ico" size="318" tmpFilename="/var/tmp/CGItemp25580" user="TWikiContributor" version="1.1"
>
>
META FILEATTACHMENT attr="" autoattached="1" comment="" date="1242161154" name="logo.gif" path="logo.gif" size="2545" user="UnknownUser" version=""
META FILEATTACHMENT attr="" autoattached="1" comment="" date="1242161154" name="favicon.ico" path="favicon.ico" size="1406" user="UnknownUser" version=""
Revision 11
28 Mar 2005 - TWikiContributor
Line: 1 to 1
 
META TOPICPARENT name="WebHome"

Sites Web Preferences

Revision 10
28 Mar 2005 - TWikiContributor
Line: 1 to 1
 
META TOPICPARENT name="WebHome"
Changed:
<
<

Sites Web Preferences

>
>

Sites Web Preferences

 
Changed:
<
<
The following settings are web preferences of the Sites web. These preferences overwrite the site-level preferences in DefaultPreferences, and can be overwritten by user preferences (your personal topic, eg: WikiGuest in the Main web).
>
>
The following settings are web preferences of the Sites web. These preferences overwrite the site-level preferences in System.DefaultPreferences and Main.SitePreferences, and can be overwritten by user preferences (your personal topic, eg: WikiGuest in the Main web).
 
Added:
>
>
 
Changed:
<
<
Preferences:
>
>

Web Preferences Settings

 
Changed:
<
<
  • List of topics of the Foswiki.Sites web:
>
>
These settings override the defaults for this web only. See full list of defaults with explanation. Many of the settings below are commented out. Remove the # sign to enable a local customisation.
 
Changed:
<
<
  • Web specific background color: (Pick a lighter one of the StandardColors)
    • Set WEBBGCOLOR = #FFFED5
>
>
  • List of topics of the Sites web:
    • #Set WEBTOPICLIST = %WEBTOPICLIST%
 
Changed:
<
<
  • List this web in the SiteMap:
    • If yes, set SITEMAPLIST to on, do not set NOSEARCHALL, and add the "what" and "use to..." description for the site map. Make sure to list only links that include the name of the web, e.g. Sites.Topic links.
>
>
 #009900 
  • Web-specific background color: (Pick a lighter one of the StandardColors).
    • Set WEBBGCOLOR = #DDDDDD
    • Note: This setting is automatically configured when you create a web

  • Image, URL and alternate tooltip text of web's logo.
    Note: Don't add your own local logos to the TWikiLogos topic; create your own logos topic instead.
    • #Set WEBLOGOIMG = /wiki/pub/Sites/WebPreferences/EMS_Full_Logo_Color_40px.png
    • #Set WEBLOGOURL = http://www.eugenemakerspace.com
    • #Set WEBLOGOALT = Eugene Maker Space

  • List this web in the SiteMap. If you want the web listed, then set SITEMAPLIST to on, do not set NOSEARCHALL, and add the "what" and "use to..." description for the site map. Use links that include the name of the web, i.e. Sites.Topic links.
    Note: Unlike other variables, the setting of SITEMAPLIST is not inherited from parent webs. It has to be set in every web that is to be listed in the SiteMap
 
    • Set SITEMAPLIST = on
Changed:
<
<
    • Set SITEMAPWHAT = Describe what this web does.
    • Set SITEMAPUSETO = ...to do something.
>
>
    • Set SITEMAPWHAT =
    • Set SITEMAPUSETO =
    • Note: Above settings are automatically configured when you create a web
 
Changed:
<
<
  • Exclude web from a web="all" search: (Set to on for hidden webs)
>
>
  • Exclude web from a web="all" search: (Set to on for hidden webs).
 
    • Set NOSEARCHALL =
Added:
>
>
    • Note: This setting is automatically configured when you create a web
 

  • Prevent automatic linking of WikiWords and acronyms (if set to on); link WikiWords (if empty); can be overwritten by web preferences:
Changed:
<
<
    • Set NOAUTOLINK =
    • Note: Use the [[...][...]] syntax to link topics in case you disabled WikiWord linking. The <noautolink> ... </noautolink> syntax can be used to prevents links within a block of text.
>
>
    • #Set NOAUTOLINK =
    • Note: You can still use the [[...][...]] syntax to link topics if you disabled WikiWord linking. The <noautolink> ... </noautolink> syntax can be used to prevents links within a block of text.
 
Changed:
<
<
  • Default template for new topics and form(s) for this web:
>
>
  • Default template for new topics for this web:
 
    • WebTopicEditTemplate: Default template for new topics in this web. (Site-level is used if topic does not exist)
Changed:
<
<
>
>

  • Comma separated list of forms that can be attached to topics in this web. See TWikiForms for more information.
 
    • Set WEBFORMS =
Changed:
<
<
  • Users or groups who are not / are allowed to view / change / rename topics in the Sites web: (See TWikiAccessControl)
    • Set DENYWEBVIEW =
    • Set ALLOWWEBVIEW =
    • Set DENYWEBCHANGE =
    • Set ALLOWWEBCHANGE =
    • Set DENYWEBRENAME =
    • Set ALLOWWEBRENAME =
>
>
  • Users or groups who are not / are allowed to view / change / rename topics in the Sites web: (See TWikiAccessControl). 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 = AdminGroup
    • #Set DENYWEBRENAME =
    • #Set ALLOWWEBRENAME = AdminGroup
 
Changed:
<
<
  • Users or groups allowed to change or rename this WebPreferences topic: (I.e. AdminGroup)
    • Set ALLOWTOPICCHANGE =
>
>
  • Users or groups allowed to change or rename this WebPreferences topic: (e.g., AdminGroup)
 
Changed:
<
<
  • Web preferences that are not allowed to be overridden by user preferences:
>
>
  • Web preferences that are not allowed to be overridden by user or topic preferences:
 
    • Set FINALPREFERENCES = NOSEARCHALL, ATTACHFILESIZELIMIT, WIKIWEBMASTER, WEBCOPYRIGHT, WEBTOPICLIST, DENYWEBVIEW, ALLOWWEBVIEW, DENYWEBCHANGE, ALLOWWEBCHANGE, DENYWEBRENAME, ALLOWWEBRENAME
Changed:
<
<
Notes:
  • A preference is defined as:
    6 spaces * Set NAME = value
    Example:
    • Set WEBBGCOLOR = #FFFFC0
  • Preferences are used as TWikiVariables by enclosing the name in percent signs. Example:
    • When you write variable %WEBBGCOLOR% , it gets expanded to #009900 .
  • The sequential order of the preference settings is significant. Define preferences that use other preferences first, i.e. set WEBCOPYRIGHT before WIKIWEBMASTER since %WEBCOPYRIGHT% uses the %WIKIWEBMASTER% variable.
  • You can introduce new preferences variables and use them in your topics and templates. There is no need to change the Foswiki engine (Perl scripts).

Related Topics:
>
>

Tools

%META:TOPICPARENT{name="AdminToolsCategory"}% #SettingPrefs

Preference Settings

A preference setting lets you define a simple macro that will be expanded in your output. A preference setting looks like this:

[multiple of 3 spaces] * [space] Set [space] MACRONAME [space] = [space] value

Example:

   * Set WEBBGCOLOR = #FFFFC0
Macros defined using preference settings are expanded by enclosing their name in percent signs. So when you write %WEBBGCOLOR%, it gets expanded to #009900

A preference macro 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:
  1. DefaultPreferences (Foswiki upgrades overwrite this topic)
  2. In (some) plugin documentation topics. (Deprecated)
  3. SitePreferences
  4. In user topics, if the user has one (yours is Main.WikiGuest)
  5. WebPreferences
  6. Sub-webs inherit the WebPreferences of their parent
  7. In the topic being accessed
In this list, Set statements which occur at numerically higher locations override macros of the same name defined 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; set statements at higher-numbered levels are ignored.

prefs-stack.jpg

Writing preference settings

Preference settings are written as a simple bullet. In TML, they are written as 3-spaces,asterisk,equals,value
   * Set MYSETTING = My setting value

When using the Wysiwyg editor, click the "Bullet" button and write the setting as a simple bullet. Don't include the asterisk.

Spaces 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 here

Whatever you include in your macro will be expanded on display, exactly as if it had been entered directly (though see Parameters, below).

Example: Create a custom logo macro
  • To place a logo anywhere in a web by typing %MYLOGO%, define the preference settings in the web's WebPreferences topic, and upload a logo file, ex: mylogo.gif. You can upload by attaching the file to WebPreferences, or, to avoid clutter, to any other topic in the same web, e.g. LogoTopic. Sample preference setting in WebPreferences:
   * Set MYLOGO = %PUBURL%/%WEB%/LogoTopic/mylogo.gif

Preference settings are case sensitive. (Foswiki by convention always writes settings in upper case.)

   * Set lower = This is LOWER
   * Set LOWER = This is UPPER
   * Set System.LoWeR = This is MIXED
Expand %lower%, %LOWER% and %LoWeR%
Expand %lower%, %LOWER% and %LoWeR%.

IDEA! preference settings can easily be disabled with a # sign. Example:
   * #Set DENYWEBCHANGE = %USERSWEB%.UnknownUser

Hiding preference settings

IDEA! You can hide preference settings in the output by enclosing them in HTML comments; for example,
<!--
   * Set HIDDEN = This will be invisible in the output
-->

You can also set preference settings in a topic by clicking the link Edit topic preference settings under 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.

ALERT! Caution If your topic will be used in an INCLUDE, it is recommended to not use HTML comments. instead, set preferences into the topic metadata by using the "Edit Settings for this topic" button on the "More topic actions" page. Settings in an included topic are always ignored, but nested comments will break the HTML.

Order of perference settings

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 setting anywhere in the topic, even if you set it at the very end. But beware: it also means that if you change the setting of a macro you are using in the same topic, Preview will show the wrong thing, and you must Save the topic to see it correctly.

Preference settings and topic revision history

Foswiki always reads the settings from the most current topic revision, so viewing older revisions of a topic can show unexpected results.

And especially important, preference settings are never overridden or set in "%INCLUDE{" topics. in the below example about weather conditions, note the difference in the CONDITIONS expansion

Parameters

<--  
-->
Note that %CONDITIONS% expands differently when this example is viewed in Macros. This is because Set statement are not active in included topics. The including topic's set statements are used.

Macros defined using preference settings can take parameters. These are symbols passed in the call to the macro to define local macros that will be expanded in the output. For example,
   * Set CONDITIONS = According to [[System.%BASETOPIC%][%BASETOPIC%]] the %WHAT% is %STATE% today (Set in ...).
You can call this macro passing in values for WHAT and STATE. For example:
  • %CONDITIONS{WHAT="sea" STATE="choppy"}%
    • expands to %CONDITIONS{WHAT="sea" STATE="choppy"}%.

Parameter defaults

  • The special parameter name DEFAULT gets the value of any unnamed parameter in the macro call.
  • Parameter macros can accept a default parameter so that they expand to something even when a value isn't passed for them in the call.
Example:
   * Set WEATHER = It's %DEFAULT{default="raining"}%.
  • %WEATHER% expands to %WEATHER%
  • %WEATHER{"sunny"}% expands to %WEATHER{"sunny"}%
The standard formatting tokens can be used in parameters. They will be expanded immediately when the macro is instantiated.

ALERT! Note that parameters override all other macros, including system defined macros, in the expansion of the macro where they are used.

Access Control Settings

These are special types of preference settings to control access to content. AccessControl explains these security settings in detail. Parameters are not available in access control settings.

Local values for preferences

Certain topics (user, plugin, web, site and default preferences topics) have a problem; macros defined in those topics can have two meanings. For example, consider a user topic. A user may want to use a double-height edit box when they are editing their home topic - but only when editing their home topic. The rest of the time, they want to have a normal edit box. This separation is achieved using Local in place of Set in the macro definition. For example, if the user sets the following in their home topic:
   * Set EDITBOXHEIGHT = 10
   * Local EDITBOXHEIGHT = 20
Then, 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. Local can 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.
<--  -->

Deprecation warning. The setting used in this example, EDITBOXHEIGHT, is being deprecated and will be remove from Foswiki 1.2. Note that if the edit box size is changed using the javascript controls in the lower right corner of the edit box window, those settings will be used, and the EDITBOX* settings will be ignored.

Related Topics

 
Added:
>
>
META FILEATTACHMENT attachment="favicon.ico" attr="" comment="placeholder favicon" date="1100974473" name="favicon.ico" path="favicon.ico" size="318" tmpFilename="/var/tmp/CGItemp25580" user="TWikiContributor" version="1.1"
Revision 9
16 Aug 2004 - PeterThoeny
Line: 1 to 1
 
META TOPICPARENT name="WebHome"

Sites Web Preferences

Changed:
<
<
The following settings are web preferences of the Sites web. These preferences overwrite the site-level preferences in DefaultPreferences, and can be overwritten by user preferences (your personal topic, i.e. WikiGuest in the Foswiki.Main web)
>
>
The following settings are web preferences of the Sites web. These preferences overwrite the site-level preferences in DefaultPreferences, and can be overwritten by user preferences (your personal topic, eg: WikiGuest in the Main web).
 

Preferences:
Line: 22 to 22
 
  • Exclude web from a web="all" search: (Set to on for hidden webs)
    • Set NOSEARCHALL =
Added:
>
>
  • Prevent automatic linking of WikiWords and acronyms (if set to on); link WikiWords (if empty); can be overwritten by web preferences:
    • Set NOAUTOLINK =
    • Note: Use the [[...][...]] syntax to link topics in case you disabled WikiWord linking. The <noautolink> ... </noautolink> syntax can be used to prevents links within a block of text.
 
Revision 8
15 Aug 2004 - ArthurClemens
Line: 1 to 1
 
META TOPICPARENT name="WebHome"

Sites Web Preferences

Line: 11 to 11
 

  • Web specific background color: (Pick a lighter one of the StandardColors)
Changed:
<
<
    • Set WEBBGCOLOR = #D0D0D0
>
>
    • Set WEBBGCOLOR = #FFFED5
 

  • List this web in the SiteMap:
    • If yes, set SITEMAPLIST to on, do not set NOSEARCHALL, and add the "what" and "use to..." description for the site map. Make sure to list only links that include the name of the web, e.g. Sites.Topic links.
Revision 7
26 Dec 2003 - PeterThoeny
Line: 1 to 1
 
META TOPICPARENT name="WebHome"

Sites Web Preferences

Line: 41 to 41
 

  • Web preferences that are not allowed to be overridden by user preferences:
Changed:
<
<
    • Set FINALPREFERENCES = NOSEARCHALL, WIKIWEBMASTER, WEBCOPYRIGHT, WEBTOPICLIST, DENYWEBVIEW, ALLOWWEBVIEW, DENYWEBCHANGE, ALLOWWEBCHANGE, DENYWEBRENAME, ALLOWWEBRENAME
>
>
    • Set FINALPREFERENCES = NOSEARCHALL, ATTACHFILESIZELIMIT, WIKIWEBMASTER, WEBCOPYRIGHT, WEBTOPICLIST, DENYWEBVIEW, ALLOWWEBVIEW, DENYWEBCHANGE, ALLOWWEBCHANGE, DENYWEBRENAME, ALLOWWEBRENAME
 

Notes:
  • A preference is defined as:
    6 spaces * Set NAME = value
    Example:
Revision 6
20 Dec 2003 - PeterThoeny
Line: 1 to 1
 
META TOPICPARENT name="WebHome"

Sites Web Preferences

Line: 38 to 38
 

  • Users or groups allowed to change or rename this WebPreferences topic: (I.e. AdminGroup)
    • Set ALLOWTOPICCHANGE =
Changed:
<
<
    • Set ALLOWTOPICRENAME =
>
>
 

  • Web preferences that are not allowed to be overridden by user preferences:
    • Set FINALPREFERENCES = NOSEARCHALL, WIKIWEBMASTER, WEBCOPYRIGHT, WEBTOPICLIST, DENYWEBVIEW, ALLOWWEBVIEW, DENYWEBCHANGE, ALLOWWEBCHANGE, DENYWEBRENAME, ALLOWWEBRENAME
Revision 5
16 Dec 2003 - PeterThoeny
Line: 1 to 1
 
META TOPICPARENT name="WebHome"

Sites Web Preferences

Line: 41 to 41
 
    • Set ALLOWTOPICRENAME =

  • Web preferences that are not allowed to be overridden by user preferences:
Changed:
<
<
    • Set FINALPREFERENCES = WEBTOPICLIST, DENYWEBVIEW, ALLOWWEBVIEW, DENYWEBCHANGE, ALLOWWEBCHANGE, DENYWEBRENAME, ALLOWWEBRENAME
>
>
    • Set FINALPREFERENCES = NOSEARCHALL, WIKIWEBMASTER, WEBCOPYRIGHT, WEBTOPICLIST, DENYWEBVIEW, ALLOWWEBVIEW, DENYWEBCHANGE, ALLOWWEBCHANGE, DENYWEBRENAME, ALLOWWEBRENAME
 

Notes:
  • A preference is defined as:
    6 spaces * Set NAME = value
    Example:
Revision 4
22 Mar 2003 - PeterThoeny
Line: 1 to 1
 
META TOPICPARENT name="WebHome"
Changed:
<
<

Foswiki.Sites Web Preferences

>
>

Sites Web Preferences

 
Changed:
<
<
The following settings are web preferences of the Foswiki.Sites web. These preferences overwrite the site-level preferences in DefaultPreferences, and can be overwritten by user preferences (your personal topic, i.e. WikiGuest in the Foswiki.Main web)
>
>
The following settings are web preferences of the Sites web. These preferences overwrite the site-level preferences in DefaultPreferences, and can be overwritten by user preferences (your personal topic, i.e. WikiGuest in the Foswiki.Main web)
 

Preferences:
Line: 14 to 14
 
    • Set WEBBGCOLOR = #D0D0D0

Changed:
<
<
    • If yes, set SITEMAPLIST to on, do not set NOSEARCHALL, and add the "what" and "use to..." description for the site map. Make sure to list only links that include the name of the web, e.g. Sites.Topic links.
>
>
    • If yes, set SITEMAPLIST to on, do not set NOSEARCHALL, and add the "what" and "use to..." description for the site map. Make sure to list only links that include the name of the web, e.g. Sites.Topic links.
 
    • Set SITEMAPLIST = on
    • Set SITEMAPWHAT = Describe what this web does.
    • Set SITEMAPUSETO = ...to do something.
Line: 28 to 28
 
    • TWikiForms: How to enable form(s)
    • Set WEBFORMS =
Changed:
<
<
  • Users or groups who are not / are allowed to view / change / rename topics in the Sites web: (See TWikiAccessControl)
>
>
  • Users or groups who are not / are allowed to view / change / rename topics in the Sites web: (See TWikiAccessControl)
 
    • Set DENYWEBVIEW =
    • Set ALLOWWEBVIEW =
    • Set DENYWEBCHANGE =
Revision 3
19 Jan 2003 - PeterThoeny
Line: 1 to 1
 
META TOPICPARENT name="WebHome"

Foswiki.Sites Web Preferences

Line: 8 to 8
  Preferences:

  • List of topics of the Foswiki.Sites web:
Changed:
<
<
>
>
 

  • Web specific background color: (Pick a lighter one of the StandardColors)
    • Set WEBBGCOLOR = #D0D0D0
Revision 2
12 Apr 2002 - PeterThoeny
Line: 1 to 1
 
META TOPICPARENT name="WebHome"

Foswiki.Sites Web Preferences

Line: 13 to 13
 
  • Web specific background color: (Pick a lighter one of the StandardColors)
    • Set WEBBGCOLOR = #D0D0D0
Added:
>
>
  • List this web in the SiteMap:
    • If yes, set SITEMAPLIST to on, do not set NOSEARCHALL, and add the "what" and "use to..." description for the site map. Make sure to list only links that include the name of the web, e.g. Sites.Topic links.
    • Set SITEMAPLIST = on
    • Set SITEMAPWHAT = Describe what this web does.
    • Set SITEMAPUSETO = ...to do something.
 
  • Exclude web from a web="all" search: (Set to on for hidden webs)
    • Set NOSEARCHALL =
 
This site is powered by FoswikiCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding Foswiki? Send feedback