Template:Team:Groningen/Header/AncestorLinks.js

function createAncestorLinks { var firstHeadingNode = document.getElementById('content').getElementsByTagName('h1')[0]; if (firstHeadingNode) { var pageTitle = firstHeadingNode.innerHTML; var prefix = pageTitle.substring(0,pageTitle.indexOf('Team:Groningen')); firstHeadingNode.innerHTML = prefix; var pnc = wgPageName.split('/'); var tc = wgTitle.split('/'); for(var i=0; i0) firstHeadingNode.appendChild(document.createTextNode(' > ')); if (i+1<pnc.length) { var link = document.createElement('a'); link.href = wgArticlePath.replace('$1',p); link.innerHTML = c;       firstHeadingNode.appendChild(link); } else { var cur = document.createElement('span'); cur.innerHTML = c;       firstHeadingNode.appendChild(cur); }   }  } } addOnloadHook(createAncestorLinks);