This script shows how to find the page that defines tag (e.g. language:dekiscript). The script uses the wiki.getsearch function to find at most one page that is tagged with the sought tag. Once found, it checks if the tag is linked to a definition page. If so, it emits a link with a description, otherwise it shows text describing that a page could not be found.
{{
var tag = "language:dekiscript";
var found = wiki.getsearch("tag:" .. tag, 1, _, "type:wiki" );
if(#found) {
var def = found[0].tags[tag].definition;
if(def) web.link(def.uri, "Tag definition at " .. def.path); else "(no definition for '".. tag .."')";
} else "(no page found)";
}}
| Images 0 | ||
|---|---|---|
| No images to display in the gallery. |
Copyright © 2011 MindTouch, Inc. Powered by