简体   繁体   中英

Include preferences from a topic

How to include preferences from another topic in Foswiki 1.1.9 ? This approach doesn't work for me:

Sandbox.MyPreferences

   * Set FOO = 1 

Sandbox.UseFoo

%INCLUDE{"Sandbox.MyPreferences"}%
Value for FOO is %FOO%

Output of Sandbox.UseFoo

Value for FOO is %FOO%

Another possibility would be to use SpreadSheet variables to accomplish something similar. Unlike Foswiki Preferences, spreadsheet variables can be set in an included topic and then used in the including topic. I've seen this used to centralize a number of calculations into a separate include topic which can then be referenced in a number of topics.

I wrote up an example from a past life. See http://foswiki.org/Support/BestPracticeTip33

No, that's not possible. * Set lists can't be %INCLUDed . However the upcoming Foswiki-1.2.0 will have a macro-equivalent to * Set which in fact will allow you to %INCLUDE them as you described. See http://foswiki.org/Development/SettingAndGettingVariablesUsingMacros .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM