Templates Wiki

Editing

Forum:Title case caps that work with links and parameters?

1
  • The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit. If you are undoing an edit that is …
Latest revision Your text
Line 1: Line 1:
{{Forumheader|Help desk}}<!-- Please put your content under this line. Be sure to sign your edits with four tildes: ~~~~ -->
+
{{Forumheader|Help desk}}
  +
<!-- Please put your content under this line. Be sure to sign your edits with four tildes: ~~~~ -->
   
So I'm trying to make a couple templates that are supposed to streamline other contributors adding data (some infobox templates and some templates that are each rows to go in a table).<br /><br />I've got them working just fine, save for a capitalization problem.<br /><br />Say I set "|a = Foo" on the content page. I have an image made by <nowiki>"[[File:{{{a}}}_icon.png]]" and a name next to it, "[[{{{a}}}]]"</nowiki> as it should.<br /><br />But I want to be able to set it up so that users could write "|a = foo" and it reinterpret "foo" to be "Foo" so as to not have broken links and non-caps titles. <nowiki>{{ucfirst:}} works, but say I need to put in Foo Bar, then {{ucfirst:}}</nowiki> would only net Foo bar, leaving it in almost sentence case.<br /><br />I've tried importing and using <nowiki>{{Fixcaps}} {{Title case}} and {{#invoke:String2|title}} and while they work fine on regular text and on [[links]]</nowiki> (for the most part), still none of them agree with parameters. They all try to just capitalize <nowiki>{{{a}}} to {{{A}}} before reading {{{a}}}</nowiki> for its contents.<br /><br />Are there any existing templates, or if not, is there any good place to start trying to make a template that'll fill this purpose?<br /><br />[[User:TerranTheMoose|TerranTheMoose]] ([[User talk:TerranTheMoose|talk]]) 21:51, July 24, 2018 (UTC)
+
So I'm trying to make a couple templates that are supposed to streamline other contributors adding data (some infobox templates and some templates that are each rows to go in a table).<br><br>I've got them working just fine, save for a capitalization problem.<br><br>Say I set "|a = Foo" on the content page. I have an image made by <nowiki>"[[File:{{{a}}}_icon.png]]" and a name next to it, "[[{{{a}}}]]"</nowiki> as it should.<br><br>But I want to be able to set it up so that users could write "|a = foo" and it reinterpret "foo" to be "Foo" so as to not have broken links and non-caps titles. <nowiki>{{ucfirst:}} works, but say I need to put in Foo Bar, then {{ucfirst:}}</nowiki> would only net Foo bar, leaving it in almost sentence case.<br><br>I've tried importing and using <nowiki>{{Fixcaps}} {{Title case}} and {{#invoke:String2|title}} and while they work fine on regular text and on [[links]]</nowiki> (for the most part), still none of them agree with parameters. They all try to just capitalize <nowiki>{{{a}}} to {{{A}}} before reading {{{a}}}</nowiki> for its contents.<br><br>Are there any existing templates, or if not, is there any good place to start trying to make a template that'll fill this purpose?
  +
[[User:TerranTheMoose|TerranTheMoose]] ([[User talk:TerranTheMoose|talk]]) 21:51, July 24, 2018 (UTC)
  Loading editor