Template:Path stripper

From Wikisphere
Revision as of 14:41, 4 December 2021 by Admin (talk | contribs) (1 revision imported)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

This template converts an internal wiki link from

[[My page/My subpage]]

or

[[My page/My subpage|My page/My subpage]]

to

[[My page/My subpage|My subpage]]

(that is it will show only the latest node of the path keeping the link intact)


The template has been conceived to be used within ask queries of Semantic Mediawiki, which can use templates to format result (see the documentation here)

It has also been inspired by the solution of Dave which can be found here (search for "Template:Path_Stripper")

***Attention, this template can be superseded using the Mediawiki's hooks HtmlPageLinkRendererBegin and SelfLinkBegin (see Wikisphere_PageProperties extension)