Template:domxref

  • Revision slug: Template:domxref
  • Revision title: Template:domxref
  • Revision id: 56078
  • Created:
  • Creator: Sheppy
  • Is current revision? No
  • Comment 148 words removed

Revision Content

/* get a page's language (Don't use page.language!) */
var u = Uri.Parts(Page.uri);
var lang = u.path[0];

/* check $0 exists */
var dest = lang + '/' + 'DOM:' + $0;
if(wiki.pageExists(dest)) {
    (web.link(wiki.uri(dest), $0));
} else {
    (web.link(wiki.uri(lang + '/' + 'DOM/' + $0), $0));
}

%>

Revision Source

<pre class="script">
/* get a page's language (Don't use page.language!) */
var u = Uri.Parts(Page.uri);
var lang = u.path[0];

/* check $0 exists */
var dest = lang + '/' + 'DOM:' + $0;
if(wiki.pageExists(dest)) {
    <code>(web.link(wiki.uri(dest), $0))</code>;
} else {
    <code>(web.link(wiki.uri(lang + '/' + 'DOM/' + $0), $0))</code>;
}

%>
Revert to this revision