||The WikiTalk topic summary is: @@topics.WikiTalk.Summary@@||
Would generate this text:
| The WikiTalk topic summary is: WikiTalk is a language for including dynamic content in FlexWiki topics. |
WikiTalk is object oriented. All data types are objects (strings, integers, booleans, Topics, Federations, etc.)
If/Then constructs are accomplished through methods on "Boolean":/default.aspx/TestJwd/InstructionCard.html?type=Boolean objects.
@@"Monday".Equals(DateTime.Now.DayOfWeek).IfTrue {"''Mondays stink''"} IfFalse {"''Most of the week is good''"}@@
Output: Most of the week is good
The IfTrue/IfFalse construct actually maps to the IfTrueIfFalse method on the "Boolean":/default.aspx/TestJwd/InstructionCard.html?type=Boolean object. The previous example is normally written:
@@"Monday".Equals(DateTime.Now.DayOfWeek).IfTrueIfFalse( {"''Mondays stink''"}, {"''Most of the week is good''"} ) @@
Output: Most of the week is good
For more information on looping, see WikiTalkLoopingDemo
WikiTalk supports functions. Functions are WikiTalk Blocks (see reference in "Looping" above) which have one or more FlexWikiParameters. Functions are named by putting them in a topic's property. This is an example of a function named Hithere:
:Hithere:{ firstname, lastname |
[ "Hi there ", firstname, lastname, "! You got to this page on ", DateTime.Now ]
}
Note that the property name Hithere begins with a colon. This tells FlexWiki that the WikiPageProperty named Hithere is hidden. For a more advanced discussion on the usage of functions, see WikiTalkFunction.
The function is called within the topic page by using the function name and passing the parameters in parens. For example
@@Hithere("Tim ", "Smith")@@
would output:
Hi there Tim Smith! You got to this page on 8/29/2008 11:42:12 PMTo call a function in another topic, use the With property which brings the other topic's properties into scope. This example puts InstructionCard in this topic's scope and then calls the LinkToInstructionCard function.
With: InstructionCard
This is a link to documentation on @@LinkToInstructionCard("Boolean")@@
Another way to call a function defined in another topic is to directly access the topic through the topics array. For example:
@@topics.WikITalkLanguageOverview.Hithere("Tim ", "Smith")@@
would output:
Hi there Tim Smith! You got to this page on 8/29/2008 11:42:12 PMNote that in this example, WikITalkLanguageOverview is the topic name that contains the HiThere function. topics.WikITalkLanguageOverview is returning a DynamicTopic which gives you access to the functions defined in the topic.