My Personal Preferences

  • Preference for the editor, default is the WYSIWYG editor. The options are raw, wysiwyg:
    • Set EDITMETHOD = wysiwyg

  • Fixed pulldown menu-bar, on or off. If off, the menu-bar hides automatically when scrolling.
    • Set FIXEDTOPMENU = off

  • Show tool-tip topic info on mouse-over of WikiWord links, on or off:
    • Set LINKTOOLTIPINFO = off

Tools

Preference Settings

A preference setting lets you define a simple macro that will be expanded in your output. In addition:
  • preference settings are used by Plugins to control their features,
  • preference settings are used for Access Control.

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 #FFEFA6

Preferences can also be set dynamically by using the %SET{"setting" value="value"}% Macro. With the exception of these dynamic preference settings, preferences are 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 WikiGuest)
  5. WebPreferences in each web.
  6. Sub-webs inherit the WebPreferences of their parent
  7. In the topic when it is loaded from the Store
  8. In SET macros for run-time preferences

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. When a preference is finalized, the macro is locked to the value at that level; SET statements at higher-numbered levels are ignored. Looking at it graphically:

prefs-stack.jpg

Access Control rules (ACLs) are also written as preference settings. ACLs cannot be dynamically modified by the %SET{}% macro.

Writing preference settings

Preference settings are written as a simple bullet. In TopicMarkupLanguage (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 or the leading spaces.

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. (Not when using the Wysiwyg editor.)

Example:

   * Set MACRONAME = value starts here
     and continues here

IDEA! preference settings can easily be disabled with a # sign. Example:

   * #Set DENYWEBCHANGE = %USERSWEB%.UnknownUser

Whatever you include in your bullet style setting will be expanded on display, exactly as if it had been entered directly (though see Parameters, below). (%SET{}% settings are expanded during the set process. See VarSET for further information.)

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 LoWeR = This is MIXED
Expand %lower%, %LOWER% and %LoWeR%

Expand %lower%, %LOWER% and %LoWeR%.

Hiding preference settings

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. If the same setting appears as both an inline setting, and in topic meta settings, the meta setting will override the inline setting! There is no warning when the setting is duplicate. This should be avoided to prevent confusion.

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 preference settings

If you are setting a preference and using it in the same topic, note that Foswiki reads all the bullet style 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.

If a preference is set in both a bullet and in META settings, the META will override the bullet.

If multiple bullet style Set statements are specified for the same preference, the last one encountered is assigned and will be used globally throughout the topic.

%SET{}% style settings are assigned during the topic rendering. So unlike bullet/META settings:
  • Preferences and their effect will be visible in the preview.
  • %SET{} will override both META and bullet style settings unless the preference is FINALIZED.
  • The %SET{} is positional in the topic. Multiple %SET{} macros for the same preference will change the value as the topic is rendered.

Preference settings and topic revision history

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

Preference settings and INCLUDE

  • Bullet and META style preference settings are never set when topic content is obtained by %INCLUDE{.
  • %SET{ style settings can be overidden when an INCLUDE is expanded, but only when referenced locally in the included topic.

In the below example about weather conditions, note the difference in the CONDITIONS expansion

Parameters

The following block of code was read from PreferenceSettings, and the "Set" statements were defined in YutingYe
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, Both Macros and PreferenceSettings have a Set statement that defines the %CONDITIONS% macro as shown here:

 * Set CONDITIONS = According to [[%TOPIC%]] the %WHAT% is %STATE% today (Set in ...).
The %TOPIC% shows where the CONDITIONS macro is expanded, and the ... shows where the Set statement was actually defined.

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"}%
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.

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. AccessControl settings cannot be set or changed by the %SET{}% macro.

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 the wiki text editor, but only when editing their home topic. The rest of the time, they want to use the default Wysiwyg editor. 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:

   * Local NOWYSIWYG = 1

Then, when they are editing any other topic, they will get the Wysiwyg editor. However, when they are editing their home topic they will get the wikitext editor. Local can be used wherever a preference needs to take a different value depending on where the current operation is being performed.

%SHOWPREFERENCE% 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.
%SHOWPREFERENCE{"CONDITIONS"}%
expands into:
  • Set CONDITIONS = ""

UserForm edit

FirstName Yuting
LastName Ye
Country
Location
Telephone
Email
I Attachment Action Size Date Who Comment
08022022.pdfpdf 08022022.pdf manage 273 K 02 Aug 2022 - 08:28 YutingYe  
Diff_heating_paper_Ye.pdfpdf Diff_heating_paper_Ye.pdf manage 1 MB 22 Sep 2023 - 09:50 YutingYe  
Diff_heating_paper_Ye_20231019.pdfpdf Diff_heating_paper_Ye_20231019.pdf manage 1 MB 19 Oct 2023 - 17:17 YutingYe  
_.pdfpdf _.pdf manage 1 MB 20 Jun 2023 - 12:56 YutingYe  
_Microsoft_PowerPoint__2.pdfpdf _Microsoft_PowerPoint__2.pdf manage 232 K 14 Jun 2022 - 10:14 YutingYe melting test report 14.6.2022
paper_discussion.pdfpdf paper_discussion.pdf manage 1 MB 20 Jun 2023 - 13:08 YutingYe  
presentation_20220927.pdfpdf presentation_20220927.pdf manage 158 K 27 Sep 2022 - 09:37 YutingYe  
presentation_20221004.pdfpdf presentation_20221004.pdf manage 198 K 04 Oct 2022 - 09:05 YutingYe  
presentation_20221025.pdfpdf presentation_20221025.pdf manage 138 K 25 Oct 2022 - 12:42 YutingYe  
presentation_20221115.pdfpdf presentation_20221115.pdf manage 208 K 15 Nov 2022 - 13:13 YutingYe  
presentation_20221213.pdfpdf presentation_20221213.pdf manage 325 K 13 Dec 2022 - 13:22 YutingYe  
presentation_20230110.pdfpdf presentation_20230110.pdf manage 119 K 10 Jan 2023 - 11:15 YutingYe  
presentation_20230131.pdfpdf presentation_20230131.pdf manage 158 K 30 Jan 2023 - 17:53 YutingYe  
presentation_20230228.pdfpdf presentation_20230228.pdf manage 732 K 28 Feb 2023 - 13:36 YutingYe  
presentation_20230328.pdfpdf presentation_20230328.pdf manage 127 K 28 Mar 2023 - 12:21 YutingYe  
presentation_20230425.pdfpdf presentation_20230425.pdf manage 186 K 25 Apr 2023 - 12:10 YutingYe  
presentation_20230509.pdfpdf presentation_20230509.pdf manage 165 K 09 May 2023 - 09:02 YutingYe  
presentation_20230530.pdfpdf presentation_20230530.pdf manage 565 K 30 May 2023 - 12:23 YutingYe  
presentation_20230718.pdfpdf presentation_20230718.pdf manage 659 K 18 Jul 2023 - 12:11 YutingYe  
presentation_20230829.pdfpdf presentation_20230829.pdf manage 163 K 29 Aug 2023 - 12:27 YutingYe  
presentation_20230919.pdfpdf presentation_20230919.pdf manage 572 K 19 Sep 2023 - 09:05 YutingYe  
presentation_20230926.pdfpdf presentation_20230926.pdf manage 607 K 26 Sep 2023 - 12:02 YutingYe  
presentation_20231024.pdfpdf presentation_20231024.pdf manage 181 K 24 Oct 2023 - 08:23 YutingYe  
presentation_20231212.pdfpdf presentation_20231212.pdf manage 1 MB 19 Dec 2023 - 09:57 YutingYe  
Topic revision: r26 - 19 Dec 2023, YutingYe
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