FANDOM


(Created page with "{{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 a...")
 
 
Line 1: Line 1:
{{Forumheader|Help desk}}
+
{{Forumheader|Help desk}}<!-- Please put your content under this line. Be sure to sign your edits with four tildes: ~~~~ -->
<!-- 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?
+
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)
[[User:TerranTheMoose|TerranTheMoose]] ([[User talk:TerranTheMoose|talk]]) 21:51, July 24, 2018 (UTC)
 

Latest revision as of 21:51, July 24, 2018

Forums: Index Help desk Title case caps that work with links and parameters?

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).

I've got them working just fine, save for a capitalization problem.

Say I set "|a = Foo" on the content page. I have an image made by "[[File:{{{a}}}_icon.png]]" and a name next to it, "[[{{{a}}}]]" as it should.

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. {{ucfirst:}} works, but say I need to put in Foo Bar, then {{ucfirst:}} would only net Foo bar, leaving it in almost sentence case.

I've tried importing and using {{Fixcaps}} {{Title case}} and {{#invoke:String2|title}} and while they work fine on regular text and on [[links]] (for the most part), still none of them agree with parameters. They all try to just capitalize {{{a}}} to {{{A}}} before reading {{{a}}} for its contents.

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?

TerranTheMoose (talk) 21:51, July 24, 2018 (UTC)

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