Template:NotFound

<%
/* Presents a "target page not found" page. */
/* Parameters: */
/*   $0: target URL that wasn't found */
/*   $1: search term (or empty string to not offer search of MXR) */
/*   $2: URL of relevant file on mozilla-central (optional) */

/* get the target page's language */

var lang = env.locale;

/* root URLs for the options */

var sourceUrl = "http://mxr.mozilla.org/mozilla-central/source/";
var searchUrl = "http://mxr.mozilla.org/mozilla-central/ident?i=";
var loginUrl = "https://developer.mozilla.org/index.php?title=Special:Userlogin&returntotitle=";

/* Heading strings in English; localize in the switch below */

var heading = mdn.localString({
    "en-US" : "That page doesn't exist yet",
    "de"    : "Diese Seite existiert bisher nicht",
    "ja"    : "この URL のページはまだ存在しません。"
});

var optionsHeading = "You have options";

/* Section body texts; localize in the switch below */

var intro = "The page you're trying to visit (" + $0 + ") doesn't exist yet. Either you came upon a bad link or you've discovered a link to an article that nobody has written yet.";

var optionsText = "<p>Here are some things things you can do now:<p><ul>";

optionsText = optionsText + "<li><a href=" + loginUrl + $0 + ">Log in</a> and <a href=" + $0 + ">create the page</a>! We're always looking for help adding new material to our documentation.</li>";

if ($2 && string.length($2)) {
    optionsText = optionsText + "<li>Read the related source or header file: " + template("Source", [$2]) + "</li>";
} 

if ($1 && string.length($1)) {
    optionsText = optionsText + "<li>" + template("LXRSearch", ["ident", "i", $1]) + "</li>";
}

switch(lang) {
    case 'de':
        intro = "Die Seite (" + $0 + "), die du versuchst, zu besuchen, existiert bisher noch nicht. Falls du willst, kannst du dich anmelden und sie erstellen.";
        break;
    default:
        break;
}

optionsText = optionsText + "</ul>";

%>


<h2><%- heading %></h2>
<p><%- intro %></p> 
<h2><%- optionsHeading %></h2>
<%- optionsText %>
Search for pages that use Template:NotFound to see example use cases and how many pages use this macro.

Document Tags and Contributors

Contributors to this page: Sebastianz, ethertank, openjck, markg, lmorchard, Sheppy
Last updated by: Sebastianz,