Widget:Basenames

/* <![CDATA[ */ $(function { var selector = "" || '.WElistsubpages';  $(selector).find('a').each(function { var atext = $(this).text.split('/').slice(-1)[0]; $(this).text(atext); }); }); /* ]]> */ Assume the anchor text of all the links within the specified selector (defaults to .WElistsubpages) are full page names. Replace the text with just the final component of the subpage name (i.e. the part to the right of the last '/').

Parameters

 * selector:container to be searched for links, if not specified, defaults to .WElistsubpages which is inserted by Template:List subpages