So what I'm trying to do is create a {{DISPLAYTITLE}}-like effect inside an infobox, but strictly for subpages when the title parameter is filled in. Some friends told me to use {{SUBPAGENAME}} inside the actual template's code but it doesn't give the results that I'm looking for (it does somewhat work if used on normal pages and not inside the code). I've been googling for examples or easy-to-comprehend examples or explanations, but no luck.

I really don't want to manually place said magic words on every separate page, just for the sake of convenience, so is there a way to do this? And can I also do something similar to sub-subpages? I don't mind having to use {{DISPLAYTITLE}} or {{SUBPAGENAME}}, it's just inconvenient having to plop those in on every subpage. Thanks :)

To be specific, this template is what I'm having issues with: [1] ; this subpage is what I'm using for reference after editing the infobox to see results: [2]. In this case I just want the page's title and infobox title to appear as "The Sweeper", and not "Epic Minigames/The Sweeper", when the title parameter is filled in. The solution should hopefully carry over to other subpages, i.e. if the title parameter is filled in a template placed on the subpage "Epic Minigames/Colossal Assault" with "Colossal Assault", then the title of the page and the infobox should say "Colossal Assault". I know using {{DISPLAYTITLE:The Sweeper}} or {{DISPLAYTITLE:Colossal Assault}} will provide what I am looking for, but I think it's just overall better not just for me but for future editors if I can get a template to just automate that + the infobox name. Any tips would be very helpful! Sorry if any of this didn't make sense lol

Community content is available under CC-BY-SA unless otherwise noted.