Template:AMInterface

  • Revision slug: Template:AMInterface
  • Revision title: Template:AMInterface
  • Revision id: 114468
  • Created:
  • Creator: Sheppy
  • Is current revision? No
  • Comment 10 words removed

Revision Content

/* accepts as input one required parameter: Addon Manager interface to create a xref to */  /* get a page's language (Don't use page.language!) */
var u = Uri.Parts(Page.uri);
var lang = u.path[0];
if(string.Contains(lang, "project") || string.Contains(lang, "Project")) {
 lang = string.Substr(lang, 8);
}

var dest = lang + '/Addons/Add-on_Manager/' + $0;

if (wiki.pageExists(dest)) { /* the page exists from the mediawiki age */
    (web.link(wiki.uri(dest),$0));
} else { /* the page doesn't exist */
    <a rel=('internal') href=(wiki.uri(dest)) class=('new')>$0a>;
}

%>

Revision Source

<pre class="script">
/* accepts as input one required parameter: Addon Manager interface to create a xref to */  /* get a page's language (Don't use page.language!) */
var u = Uri.Parts(Page.uri);
var lang = u.path[0];
if(string.Contains(lang, "project") || string.Contains(lang, "Project")) {
 lang = string.Substr(lang, 8);
}

var dest = lang + '/Addons/Add-on_Manager/' + $0;

if (wiki.pageExists(dest)) { /* the page exists from the mediawiki age */
    <code>(web.link(wiki.uri(dest),$0))</code>;
} else { /* the page doesn't exist */
    <code><<span class="start-tag">a</span><span class="attribute-name"> rel</span>=(<span class="attribute-value">'internal') </span><span class="attribute-name">href</span><span>=</span>(<span>wiki.uri(</span>dest<span>)) </span><span class="attribute-name">class</span>=<span class="attribute-value">('new')></span>$0</<span class="end-tag">a></span></code>;
}

%>
Revert to this revision