Editing WikiDB/Repeat tag syntax

From TestWiki
Jump to: navigation, search

Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.

The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.
Latest revision Your text
Line 5: Line 5:
 
  <repeat table="..." criteria="..." sort="...">Any old wiki text, with {{{variable}}} substitution.</repeat>
 
  <repeat table="..." criteria="..." sort="...">Any old wiki text, with {{{variable}}} substitution.</repeat>
  
The tag recognises the following attributes:
+
The table attribute is required, and defines where the data comes from.  The table does not need to be defined on the wiki - the tag will pull data for all rows that specified this table, even if the table does not exist.
  
; table (required)
+
The criteria is optionalSpecifying this allows you to specify which records to returnOptions are currently ''very'' limited, partly due to limitations of passing in an attributeCurrently you can provide a comma-separated list of "field=value" or "field!=value" pairs, which are ANDed together.
: This defines where the data comes from.  The table does not need to be defined on the wiki - the tag will pull data for all rows that specified this table, even if the table does not exist.
+
; criteria (optional)
+
: Specifying this allows you to restrict the set of records that are displayedIf no criteria is specified, all rows are included.
+
; sort (optional)
+
: The rows are sorted by the fields in the order specifiedIf no sort is specified, then the sort order is undefined and may vary between page views.
+
  
Full syntax for the criteria and sort attributes is the same as is used on the 'viewdata' tab to live-filter the data. See [[WikiDB/Querying data]] for full details. Note that, in the context of an HTML attribute, the <code>&lt;</code> character is not allowed, therefore you should use <code>LT</code> and <code>LTE</code> instead of <code>&lt;</code> and <code>&lt;=</code> in this context.
+
The sort contains a comma separated list of fields with an optional 'DESC' modifier (e.g. "Field1,Field2 DESC,Field3").  The rows are sorted by the fields in the order specified.
  
 
== Controlling the rendering ==
 
== Controlling the rendering ==
Line 36: Line 31:
 
|-
 
|-
 
</header>
 
</header>
| '''{{{Name}}}''' <small>{{{Location}}}</small> || {{{Revenue|Unknown}}}<br>
+
| '''{{{Name}}}''' <small>{{{Location}}}</small> || {{{Revenue}}}<br>
 
|-
 
|-
 
<footer>
 
<footer>
Line 50: Line 45:
 
|-
 
|-
 
</header>
 
</header>
| '''{{{Name}}}''' <small>{{{Location}}}</small> || {{{Revenue|Unknown}}}<br>
+
| '''{{{Name}}}''' <small>{{{Location}}}</small> || {{{Revenue}}}<br>
 
|-
 
|-
 
<footer>
 
<footer>

Please note that all contributions to TestWiki may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see TestWiki:Copyrights for details). Do not submit copyrighted work without permission!

To edit this page, please answer the question that appears below (more info):

Cancel | Editing help (opens in new window)