The following script show how to list all the incoming links for a given page.
// Set this path to the page you want the incoming links for, or page.path for the current page.
var path = "Deki/Extensions";
// create list of incoming pages with their paths and titles
var inbound = [ { path: xml.text(entry, "path"), title: xml.text(entry, "title") }
foreach var entry in wiki.api(site.api & "pages" & ("=" .. uri.encode(uri.encode(path))))["inbound/page"]
];
// display list of incoming pages
<ul>
foreach(var entry in inbound) {
<li> web.link(wiki.appendpath(site.uri, entry.path), entry.title); </li>
}
</ul>
| Images 0 | ||
|---|---|---|
| No images to display in the gallery. |
Copyright © 2011 MindTouch, Inc. Powered by
// Set this path to the page you want the incoming links for, or page.path for the current page.
var targetpath = $path;
var targetpage = wiki.getpage(targetpath);
var metadata = wiki.api(targetpage.api);
<ul>
foreach(var link in metadata["inbound/page"]) {
<li> web.link(uri.build(site.uri, xml.text(link, "path")), link.title); </li>
}
</ul>