Template:Firefox for developers

<div class="multiColumnList">
<ul>
<%
/*
 * $0 max version to list
 *
 */
  
var maxVersion = $0;
    minVersion = maxVersion - 30;

if (minVersion < 4) { minVersion = 4 }

// for href attr
var slug = mdn.localString({
    "en-US" : "Releases",
    "fr" : "Versions"
});

// for content
var str = mdn.localString({
    "fr" : ["Firefox ", " pour les développeurs"],
    "en-US": ["Firefox ", " for developers"]
});

var loc = mdn.localString({
    "en-US" : "en-US",
    "fr" : "fr",
    "ja": "ja",
    "zh-CN": "zh-CN"
});

// for newer version
for (var i = maxVersion; i >= minVersion; i--) {
    %><li><a href="/<%-loc%>/docs/Mozilla/Firefox/<%- slug %>/<%- i %>"><%- str[0] %><%- i %><%- str[1] %></a></li><%
}

// for older version
if (minVersion == 4) {
  var ov = ["3.6", "3.5", "3", "2", "1.5"];
  var ovStart = ov.indexOf($0);
  if (ovStart == -1) {
    ovStart = 0;
  }
  for(var i = ovStart; i < ov.length; i++) {
      %><li><a href="/<%-loc%>/docs/Mozilla/Firefox/<%- slug %>/<%- ov[i] %>"><%- str[0] %><%-ov[i]%><%- str[1] %></a></li><%
  }
}

/*
    This template is difficult. Because, old "fr" page have other rule...
    If the URL of your country's page is the same as the English pages,
    You just have to add your country into the object in argument of mdn.localString.
    
    And, some old pages have this link: "https://developer.mozilla.org/en-US/docs/Updating_web_applications_for_Firefox_3"
*/

%></ul>
</div>
Search for pages that use Template:Firefox for developers to see example use cases and how many pages use this macro.

Document Tags and Contributors

Contributors to this page: Sheppy, ethertank, trevorh, FredB
Last updated by: trevorh,