W3TPL/tag/load: Difference between revisions
Jump to navigation
Jump to search
(Created page with "==Parameters== * '''echo''' - if present, echo the page's parsed contents * '''let'''=''name of var to receive page's contents'' * '''local''' - if present, page is parsed in its...") |
m (updated syntax highlighting tag) |
||
Line 5: | Line 5: | ||
* '''page'''=''name of wiki page to load'' | * '''page'''=''name of wiki page to load'' | ||
==Examples== | ==Examples== | ||
<xml> | 2019-12-31: This example may be obsolete. | ||
<source lang=xml> | |||
<func ShowRecentLinks max> | <func ShowRecentLinks max> | ||
<let name=idx /> | <let name=idx /> | ||
Line 29: | Line 30: | ||
</for> | </for> | ||
</func> | </func> | ||
</ | </source> |
Revision as of 21:28, 31 December 2019
Parameters
- echo - if present, echo the page's parsed contents
- let=name of var to receive page's contents
- local - if present, page is parsed in its own context rather than parent's
- page=name of wiki page to load
Examples
2019-12-31: This example may be obsolete.
<func ShowRecentLinks max>
<let name=idx />
<let name=including val=1 />
<for table="qryW3_Titles_Catgs" where="(cl_to='Data/links') AND (page_namespace=0)" sort="page_title DESC" limit=$max name=pg hide>
<let name=pg_title val="@row.page_title" />
<let name=idx inc />
<if not flag=noLoad>
<load page=$pg_title />
</if>
<if flag=data[Title]>
<call GetLinkBrief />
</if><else>
<!-- if no new-style data, just display link to page so we can fix the problem: -->
<let name=links.out>
* [[</let>
<let name=links.out append copy=pg_title />
<let name=links.out append>]]</let>
</else>
<let name=links.rtn append copy=links.out />
<let name=links.out />
<let name=data />
</for>
</func>