You are here:
BACCHUS Wiki
>
System Web
>
Macros
>
VarEXPAND
(revision 1) (raw view)
#VarEXPAND ---+++ EXPAND{"expression" scope="topictoexpandin" ...}% Expands macros in =expression= as if they were used in the topic =topictoexpandin=. The viewer must have VIEW access to =topictoexpandin= for this to work. All the standard formatting macros can be used in =expression=, such as =$percent= and =$quot=. =EXPAND= can be useful when you want to pick up the value of macros defined in another topic. For example, you might want to define a set of preferences in one topic, but pick up their value in another topic (this is very useful when building reusable applications). In this case you can write: <pre class="tml"> *<nop> Set MYPREFERENCE = value </pre> in "SettingsTopic" and then, in "MyTopic", write: <verbatim class="tml"> %EXPAND{"$percentMYPREFERENCE$percent" scope="SettingsTopic"}% </verbatim> Of course we can also write: <verbatim class="tml"> %EXPAND{"$percentMYPREFERENCE$percent" scope="%OTHERTOPIC%"}% </verbatim> which lets us select which other topic to get the preference value from. Additional parameters can be passed to the macro being expanded using the standard macro syntax in the name of the macro; for example, <verbatim class="tml"> %EXPAND{"$percentMYPREFERENCE{$quotdefault$quot param=$quotvalue$quot}" scope="SettingsTopic"}% </verbatim> Notes: * =EXPAND= is not very efficient, and should be used sparingly. * To expand a web preference (for example, a web access control) then set =scope="Theotherweb.%<nop>WEBPREFSTOPIC%"= <!--%JQREQUIRE{"chili"}%-->
E
dit
|
A
ttach
|
P
rint version
|
H
istory
: r1
|
B
acklinks
|
V
iew topic
|
Edit
w
iki text
|
M
ore topic actions
Topic revision: r1 - 18 Nov 2013,
UnknownUser
System
Log In
Toolbox
Users
Groups
Index
Search
Changes
Notifications
RSS Feed
Statistics
Preferences
User Reference
BeginnersStartHere
TextFormattingRules
Macros
FormattedSearch
QuerySearch
DocumentGraphics
SkinBrowser
InstalledPlugins
Admin Maintenance
Reference Manual
AdminToolsCategory
InterWikis
ManagingWebs
SiteTools
DefaultPreferences
WebPreferences
Categories
Admin Documentation
Admin Tools
Developer Doc
User Documentation
User Tools
Copyright &© by the contributing authors. All material on this site is the property of the contributing authors.
Ideas, requests, problems regarding BACCHUS Wiki?
Send feedback