User:Davidgothberg/Test44
String length template names
Testing possible template names for the string length comparison templates. Each name within a group below is equivalent, we only need one template for each group. Question is which names can best be understood by editors and work well technically.
Group A: {{str < len}}1 - {{str ( len}} - {{str ≥ len}}2 - {{str >= len}}1 - {{str lt len}}
Group B: {{str > len}}1 - {{str ) len}} - {{str ≤ len}}2 - {{str <= len}}1 - {{str gt len}}
Group C: {{str == len}}3 - {{str ≈ len}} - {{str ≠ len}}2 - {{str != len}}3 - {{str eq len}}
Group D: {{str >=< len}}1 - {{str ≥ ≤ len}}2 - {{str ≤ ≥ len}}2 - {{str <=> len}}1
1 = Can't be used as template names since MediaWiki doesn't accept those characters in page names.
2 = Can't be typed on keyboards, so the users will have to copy and paste those template names. But works perfectly in MediaWiki, so perhaps are the best choices.
3 = Has some problems with the template name since contains "=" which makes it tricky to add as a parameter to other templates such as {{tl}}.
Examples
Checking if the string "abcde" is 4 characters or more:
{{str ≥ len | abcde | 4
| Equal or longer.
| Shorter.
}}
It would return this data:
- Equal or longer.
I am also planning to make a template named {{if str len}} or perhaps {{str len compare}}, that could be used like this:
{{#switch: {{if str len| abcde | 4 }}
| shorter = Shorter data.
| equal
| longer = Equal or longer data.
}}
It would return this data:
- Equal or longer data.
Content Disclaimer
Informasi ini disarikan dari Wikipedia dan disajikan kembali untuk tujuan edukasi. Konten tersedia di bawah lisensi CC BY-SA 3.0. Kami tidak bertanggung jawab atas ketidakakuratan data yang bersumber dari kontribusi publik tersebut.
- The information displayed on this website is sourced in part or in whole from Wikipedia and has been adapted for the purpose of restating it. We strive to provide accurate and relevant information, however:
- There is no guarantee of absolute accuracy. Wikipedia is an open, collaborative project that can be edited by anyone, so information is subject to change.
- It is not intended to constitute professional advice. The content displayed is for informational and educational purposes only. For important decisions (e.g., medical, legal, or financial), please consult a professional.
- Content copyright. Wikipedia is licensed under the Creative Commons Attribution-ShareAlike License (CC BY-SA). This means that content may be reused with appropriate attribution and shared under a similar license.
- Responsible use. Any risk arising from the use of information from this website is entirely the responsibility of the user.