Help:TemplateData/he

PD הערה: כאשר אתם עורכים דף זה, אתם מסכימים לשחרר את תרומתכם תחת רישיון CC0. למידע נוסף ראו את דפי העזרה בנושא נחלת הכלל. PD

TemplateData הוא דרך לשמור מידע על תבנית ויקי והפרמטרים שלה, כך שהעורך החזותי יוכל להציג אותה בעורך התבניות -- ובכך להקל על עריכת הדפים המשתמשים בתבנית הזאת. It also provides a user interface for discovering templates.

החל מאפריל 2019, "נתוני תבנית" היא ברירת מחדל עבור כלל משתמשי ויקי מדיה כאשר הם מוסיפים תבנית, אפילו משתמשים לא רשומים. נתוני תבנית משתלב הן בעריכת קוד מקור והן בעריכה חזותית בצורה כזו או אחרת, וכך גם סקריפטים, כלים וגאדג'טים רבים. אם אתה מעוניין באפשרות הזו בשביל הויקי שלך, התקן את Extension:TemplateData.

הוספת נתוני תבנית לתבנית לשימוש בהרחבה זו כרוכה בהכנסת בלוק קטן ופשוט של JSON (הסבר להלן) לדף התיעוד של התבנית. ניתן לעשות זאת באופן ידני או באמצעות עורך נתוני התבניות, ממשק משתמש גרפי שניתן לגשת אליו בדפי עריכה/עריכת קוד מקור של תבנית באתרי ויקי כאשר ההרחבה TemplateData מותקנת. קובץ ה-JSON מכיל רשימה של פרמטרי התבנית ומידע על פרמטרים אלה ועל התבנית כולה (ראה פרטים בהמשך).

תבניות המכילות נתוני תבנית יציגו מידע זה בממשק המשתמש כאשר משתמש מוסיף את התבנית. במקרים מסוימים, הדבר ישנה את אופן הפעולה של העורך בעת שימוש בו לעריכה או הוספה של תבנית נתונה, מה שיקל מאוד על המשתמשים לבצע את השלבים הדרושים להוספת תבנית נתונה.

היסטוריה

נתוני התבנית פותחו במקור בתחילת 2013 תוך מחשבה על VisualEditor, אשר היה בשלבי בדיקה של מדיה-ויקי באותה תקופה. העורך החזותי הוא ממשק העריכה החזותית העיקרי עבור אתרי ויקי של ויקימדיה, ונתוני התבניות מאפשרים לו ממשק שימושי יותר בעת הוספת תבניות. הוא נתמך באופן רשמי על ידי העורך החזותי מיידית. כאשר העורך הוויזואלי הוכנס לאתרי הויקי העיקריים השונים של ויקימדיה כתכונה ברירת מחדל בין השנים 2013 ל-2016, גם נתוני התבניות הפכו לחלק מהם.

בדצמבר 2016, ממשק העורך הוויזואלי הועמד לרשות עריכת קוד מקור כגרסת בטא. זה כונה כעורך קוד מקור 2017. זה הביא את התכונות של נתוני תבנית לעריכת מקורות בפעם הראשונה.

במרץ 2018, סם וילסון פיתח את TemplateWizard, הרחבת עורך תבניות ממשק משתמש גרפי (GUI) עבור עורך המקורות המוגדר כברירת מחדל של ויקימדיה, WikiEditor (הידוע גם כעורך ויקיטקסט משנת 2010), שנועד להקל על תהליך הוספת התבניות באמצעות מידע מנתוני התבניות. באפריל 2019, TemplateWizard הפך לחלק ברירת מחדל בעורך הטקסט של ויקימדיה משנת 2010 בכל אתרי הויקי של ויקימדיה. משמעות הדבר היא שנתוני התבנית הפכו כעת לחלק ברירת מחדל הן בעורך הוויזואלי והן בעורך המקור באתרי ויקי של ויקימדיה.


הוספה או עריכה של נתוני תבנית

כדי להוסיף או לערוך נתוני תבנית, ראשית נווטו לדף של תבנית, הממוקם ב-"/Template:Templatename".

בדיקת המצב הנוכחי

לפני הוספה או עריכה של נתוני תבנית, בדוק האם לתבנית יש דף משנה של תיעוד. לאחר מכן, בדוק האם התבנית כבר מכילה נתוני תבנית, ואם כן, האם היא ממוקמת בדף התבנית או בדף המשנה של התיעוד.

ודא שאתה בודק אם קיים דף משנה. אם תוסיף נתוני תבנית לדף הראשי של תבנית כאשר קיים דף משנה עם נתוני תבנית, נתוני התבנית בדף הראשי יעקפו את הנתונים בדף המשנה.

דפי משנה של תיעוד

ישנן שתי דרכים עיקריות בהן תבניות ברוב אתרי הויקי של ויקימדיה מאחסנות את הערות השימוש שלהן ונתונים אחרים שלא צריכים להיכלל בתבנית עצמה, כמו קטגוריות שהתבנית צריכה להיכלל בהן:

  • הרוב המכריע של התבניות שומרות הערות שימוש ונתונים אחרים שאינם שייכים לדף התבנית עצמו בדף משנה של תיעוד: "/Template:Templatename/doc". בדפים כאלה, התבנית {{Documentation}} כוללת את כל תוכן הדף /doc בדף התבנית, מה ששומר על קוד המקור של התבנית נקי הרבה יותר.
    • בתבניות עם דפי משנה של תיעוד, הכותרת " תיעוד תבנית" תלווה קישורים כגון [הצגה], [עריכה], [היסטוריה] ו-[מחיקה].
  • מספר דפי תבנית שמרו על מידע זה בדף הראשי של התבנית. ניתן לאתר זאת בדפים אלה על ידי חיפוש הופעה של {{Documentation|content= בין תגיות <noinclude>.

אתרי ויקי שונים עשויים להציג את כל זה בצורה שונה. לעתים רחוקות, דפי תבנית ראשיים עדיין עשויים להכיל תיעוד גם לאחר שבדקתם את כל האמור לעיל; כאן, משתמש יוסיף כותרת דף /doc מותאמת אישית בין "{{Documentation|" ל-"|content=" ולאחר מכן יוסיף תוכן אחרי "|content=".

ניתן גם לחפש הודעה בתחתית העמוד בדומה לזו: "התיעוד הנ"ל כלול ב-Template:Templatename/doc".

תבניות ללא דפי משנה של תיעוד

אם לתבנית אין דף משנה של תיעוד, צור אותה והעבר לשם את תיעוד התבנית (או מציין מיקום עבורה). לאחר מכן תוכל להוסיף נתוני תבנית לדף המשנה של התיעוד.

יצירת דף המשנה והעברת התיעוד
באתרי ויקי רבים של ויקימדיה, ניתן ליצור דף רק אם היית משתמש רשום שם במשך מספר ימים וביצעת מספר מינימלי של עריכות.

כדי ליצור את דף המשנה של התיעוד, לחצו על עריכה/עריכת קוד מקור בדף התבנית הראשי; חפשו את התגים <noinclude> ואת תוכנם (בדרך כלל בתחתית).

זה אמור להיראות בערך כך:

<noinclude>
{{Documentation|content=
== שימוש ==

מידע על השימוש.

== כותרות נוספות לדוגמה ==

תוכן נוסף לדוגמה

[[קטגוריה:קטגוריית דוגמה]]
[[קטגוריה:קטגוריית דוגמה 2]]
}}
</noinclude>

ייתכן שתגלה שהוא כבר מכיל נתוני תבנית. אם כן, זה ייראה בערך כך:

<noinclude>
{{Documentation|content=
...
<templatedata>
{
    "description": "",
    "params": {
        "1": {
            "label": "פרמטר לדוגמה",
            "description": "תיאור פרמטר לדוגמה",
            "type": "string"
        }
    }
}
</templatedata>
</noinclude>

בחר את כל מה שאחרי "|content=" ולפני "</noinclude>" וגזור אותו ללוח או שמור אותו במסמך זמני. מחק את "|content=", והשאיר רק את הדברים הבאים:

<noinclude>
{{Documentation}}
</noinclude>

שמור את דף התבנית.

כעת, כדי ליצור את דף המשנה החדש, עיין בשורת הכתובת של הדפדפן שלך והוסף /doc לסוף כתובת ה-URL. לחץ על ↵ Enter, לאחר מכן בחר באפשרות ליצור דף חדש.

אם לויקי הזה יש תבנית הודעה של {{Documentation subpage}}, הוסף אותה בראש הדף החדש. ייתכן שתרצו גם להוסיף תבניות אחרות, כגון קישור {{Purge button}} או {{Purge}} (אם נתמך על ידי הויקי המדובר).

הכנס את הטקסט שגזרת או שמרת בטקסט הקודם (מתחת לתבנית ההודעה, אם רלוונטי).

עטוף כל קטגוריה בתגיות <includeonly> כך שהן יחולו רק על הדף הראשי של התבנית:

<includeonly>
[[Category:Example category]]
[[Category:Example category 2]]
</includeonly>

להרבה אתרי ויקי יש תבניות {{Sandbox other}}. השתמש בתבנית זו כאן אם סביר להניח שהתבנית שאתה עורך קיימת בגרסת ארגז חול (הנמצאת ב-"Template:Templatename/sandbox") על מנת למנוע מהקטגוריות להחיל על דף ארגז החול:

<includeonly>{{sandbox other||
[[Category:Example category]]
[[Category:Example category 2]]
}}</includeonly>

לבסוף, פרסמו את הדף.

כעת ניתן להוסיף ולערוך את נתוני התבנית בדף המשנה של התיעוד באמצעות ההוראות המתוארות ב-#גישות.

הוספה ועריכה של נתוני תבנית בדף התבנית הראשי

אם אינך מצליח ליצור את דף /doc, תוכל להוסיף ולערוך נתוני תבנית בדף הראשי של התבנית על ידי ביצוע ההוראות ב-#גישות.

אם לתבנית יש דף משנה של תיעוד, בדקו גם את הדף הראשי וגם את דף המשנה של התיעוד לאיתור נוכחות של נתוני תבנית (התג <templatedata> ואחריו מערך בתוך סוגריים מסולסלים: {}).

לחלופין, התוסף TemplateData יכול לבצע בדיקה זו עבורך. לחץ על עריכה או עריכת קוד מקור בכל אחד מהדפים. אם לתבנית כבר יש נתוני תבנית באחד מהדפים, תראו הודעה צהובה בראש הדף שתציין אחת מהאפשרויות הבאות:

לתשומת ליבך: כבר יש בלוק נתוני תבנית בדף הקשור "Template:Templatename/doc".

או

לתשומת ליבך: כבר יש בלוק נתוני תבנית בדף הקשור "Template:Templatename".

אם לתבנית יש נתוני תבנית בדף המשנה של התיעוד שלה

אם לתבנית יש נתוני תבנית בדף המשנה של התיעוד שלה, זהו הדף שעליך לערוך. ניתן לעשות זאת על ידי לחיצה על "[עריכה]" הממוקם לאחר הכותרת " תיעוד תבנית" (או כדומה), או, אם אתם כבר בדף /doc, על ידי לחיצה על עריכה או עריכת קוד מקור בחלק העליון. פעל לפי ההנחיות ב#גישות כדי להוסיף או לערוך את נתוני התבנית.

אם לתבנית יש נתוני תבנית בדף הראשי שלה

אם לתבנית יש נתוני תבנית בדף הראשי שלה, שוב יש לך שתי אפשרויות:

  • באפשרותך לעבור לדף המשנה של התיעוד שלו. זוהי האפשרות המועדפת.
  • לחלופין, ניתן לערוך אותו בדף התבנית הראשי.

העברת נתוני תבנית לדף המשנה של התיעוד

לשם כך, לחצו על עריכה/עריכת קוד מקור בדף התבנית הראשי, וחפשו את התגים <templatedata>, המוקפים בתגים <noinclude>. זה אמור להיראות בערך כך:

<noinclude>
{{Documentation}}
<templatedata>
{
    "description": "",
    "params": {
        "1": {
            "label": "פרמטר לדוגמה",
            "description": "תיאור פרמטר לדוגמה",
            "type": "string"
        }
    }
}
</templatedata>
</noinclude>

גזור רק את התגיות <templatedata> ואת תוכנן מהקוד, ולאחר מכן שמרו את הדף.

לאחר מכן, ערוך את דף המשנה של התיעוד על ידי לחיצה על "[עריכה]" הממוקם לאחר הכותרת " תיעוד תבנית" (או כדומה).

הקלד כותרת, כמו "נתוני תבנית", ולאחר מכן הדבק מתחתיה את נתוני התבנית.

כעת ניתן לערוך את נתוני התבנית בהתאם להנחיות ב-#גישות.

עריכת נתוני תבנית בדף התבנית הראשי

אם אינך מעוניין להעביר את נתוני התבנית לדף /doc, תוכל לערוך אותם בדף התבנית הראשי. ראה #גישות כיצד לערוך נתוני תבנית.

אם לתבנית עדיין אין נתוני תבנית אך יש לה דף משנה של מסמך

אם לתבנית עדיין אין נתוני תבנית, עליך להוסיף אותם לדף המשנה של התיעוד.

עשה זאת על ידי לחיצה על "[עריכה]" הממוקם לאחר הכותרת " תיעוד תבנית" (או כדומה), או, אם אתה כבר בדף /doc, על ידי לחיצה על עריכה או עריכת קוד מקור בחלק העליון. הקלד כותרת, כמו "נתוני תבנית", ולאחר מכן הוסף אותה מתחת לכותרת זו. הסעיף #גישות מסביר כיצד להוסיף נתוני תבנית.

גישות

גישת עורך נתוני תבנית

זוהי דרך פשוטה להוסיף או לערוך נתוני תבנית, מומלצת למשתמשים פחות מנוסים.

עורך נתוני התבניות הוא ממשק משתמש גרפי להוספה ועריכה של נתוני תבניות. זהו חלק מהרחבת TemplateData, הזמינה בכל דף של תבנית (או דף משנה של תיעוד) על ידי לחיצה על עריכה או עריכת קוד מקור.

לאחר לחיצה על עריכה או עריכת קוד מקור, תראה כפתור מעל אזור העריכה וכותרת הדף שאומר עריכת נתוני תבנית.

לחיצה על הכפתור הזה תפתח את עריכת נתוני תבנית. אם הדף שבו אתה נמצא כבר מכיל נתוני תבנית, הוא יופיע כאן באופן אוטומטי.

צילום מסך של כלי עריכת נתוני תבנית

תכונות בחלון למעלה:

  • הפריט העליון בוחר את שפת טקסט הממשק. הוא מאפשר לך להזין תוכן טקסט במספר שפות, המוצג למשתמשים בהתבסס על ההגדרות שלהם בהעדפות, לא בהתבסס על שפת הויקי; לאתרי ויקי שונים יש מסדי נתונים של תבניות שונים לחלוטין. אם לא קיימים נתוני תבנית שפה, הממשק יציע למשתמשים רק את שפת הויקי, אך משתמשים יכולים ללחוץ על הוספת שפה כדי להוסיף קלט נוסף. קוד השפה מוצג בסוגריים לצד הפרמטרים שעליהם ניתן להחיל אותו, כגון תיאורים ותוויות.
  • הפריט הבא הוא תיאור התבנית. זהו תיאור התבנית כולה; הוא מוצג למשתמשים במקומות רבים בעורכי התבניות בעת הוספת תבנית. הפרמטר והשפעותיו מתועדות להלן.
  • הפריט השלישי שולט בעיצוב הויקיטקסט של התבנית. פרמטר זה קובע כיצד ייערך הויקיטקסט כאשר המשתמש לוחץ על החלה, שני הסוגים העיקריים הם "inline" (בשורה אחת) ו-"block" (בשורות חדשות). פרמטר זה והשפעותיו מתועדים להלן.
אם המשתמש בוחר באפשרות מיוחד, הוא יכול להזין טקסט ויקי תחת מחרוזת עיצוב מיוחד בהתאם לכללי פורמטים מותאמים אישית המתועדים להלן, על מנת ליצור פריסה מותאמת אישית לתבנית כאשר המשתמש לוחץ על החלה.
  • הפריט הרביעי מגדיר את הפרמטרים של התבנית. אם פרמטרים כבר הוגדרו בנתוני התבנית, אזור זה מציג אותם ברשימה. אם קוד המקור של התבנית מציין פרמטרים שעבורם לא קיימים נתוני תבנית, ייתכן שתראה כפתור שכותרתו הוספת 2 פרמטרים מוצעים. העורך מחלץ את ההצעות הללו מקוד המקור של התבנית על ידי חיפוש אחר {{{parametername}}} או {{{parametername|}}}. לחיצה על הוספת 2 פרמטרים מוצעים תוסיף פרמטרים אלה באמצעות שמם כפי שהוגדרו בקוד המקור. הודעה ירוקה תופיע גם בחלק העליון, לדוגמה, "נוספו 2 פרמטרים חדשים: שמות של פרמטרים".
  • בתחתית החלון תראה כפתור של הוספת פרמטר. זה מאפשר לך להוסיף פרמטר באופן ידני עם שם מותאם אישית.

המשך לשלב הבא על ידי לחיצה על אחד מהפרמטרים ברשימה. פעולה זו תאפשר לך לערוך את פרטי הפרמטר.

צילום מסך של עורך נתוני התבנית, המציג אפשרויות פרמטרים

כל התכונות הללו וההשפעות שלהן מפורטות בסעיף #בתוך שם הפרמטר.

* עורך נתוני התבנית לא יאפשר לך לשנות פרמטר ל-"שם" ריק. פרמטרים בנתוני תבנית שמקבלים איכשהו מחרוזות ריקות כשמות לא יגרמו לבעיות בעורך הויקיטקסט של 2010 עם TemplateWizard, אך לא העורך החזותי ולא עורך הויקיטקסט של 2017 יציגו אותם כלל. זהו השדה החובה היחיד בעורך נתוני התבנית.
  • לחיצה על הסרת המידע על הפרמטר תמחק את הפרמטר וכל המידע שלו מנתוני התבנית. לא ניתן לאחזר או לבטל זאת בנתוני התבנית אלא אם כן תלחצו על "X" לאחר מכן. ניתן לבטל כל שינוי שבוצע לאחר לחיצה על החלה על ידי לחיצה על Ctrl+Z.
  • יציאה מעורך נתוני התבנית לאחר ביצוע שינויים תבקש ממך לאשר שברצונך לבטל את השינויים שלך.

כשתסיים, לחץ על החלה. פעולה זו תוסיף אוטומטית את נתוני התבנית בתחתית העמוד לפני התג </noinclude>; או, אם כבר קיים, הוא יעודכן במידע החדש מבלי לשנות את מיקומו. טקסט נתוני התבנית ייבחר גם כן כשתלחצו על החלה.

עורך נתוני התבנית יוצר פרמטר "paramOrder" בתחתית נתוני התבנית (או מעדכן אותו אם הוא כבר קיים). paramOrder מכיל את פרמטרי נתוני התבנית הנוכחיים בסדר שבו הם הוצגו על ידי עורך נתוני התבנית. ניתן לשנות את ה-paramOrder על ידי גרירת הפרמטרים למעלה ולמטה בעורך נתוני התבנית באמצעות שלושת הפסים האופקיים משמאל. paramOrder והשפעותיו מתועדות להלן.

לאחר מכן, לחץ על שמירה כדי לשמור את הגרסה שלך לדף.

הגישה הידנית

אתה יכול גם להוסיף או לערוך נתוני תבנית באופן ידני. הקוד של נתוני התבנית כתוב ב-JSON, אבל לא חובה לדעת JSON בשביל ליצור נתוני תבנית. נתוני התבנית פועלים לפי כמה כללים פשוטים מאוד ומקבלים רק כמה עשרות פרמטרים וערכים מוגדרים מראש, בדרך כלל בפורמט "parameter": "value".

הוספת נתוני תבנית באופן ידני

שיקולים:

  • אם אתם מוסיפים נתוני תבנית לדף המשנה של התיעוד של תבנית (מומלץ), תוכלו להוסיף אותם בכל מקום בדף; בדקו אם בויקיפדיה בשפה שלכם יש מיקום מועדף עבורם. לדוגמה, בויקיפדיה האנגלית, נתוני התבנית נמצאים בדרך כלל בחלק התחתון של דף התיעוד; בויקיפדיה הגרמנית, הם בדרך כלל נמצאים בחלק העליון.
  • אם אתם מוסיפים נתוני תבנית בדף הראשי של תבנית (לא מומלץ; ראו #בדיקות קודמות), עליכם לוודא שאתם ממקמים אותם בתוך התגים <noinclude>...</noinclude>.

לחץ על עריכה או עריכת קוד מקור בדף המתאים, לאחר מכן עבור למקום בדף שבו ברצונך להוסיף נתוני תבנית וכתוב כותרת: "נתוני תבנית".

אתרי ויקי רבים מציעים תבנית של {{TemplateData header }} שמוסיפה הודעה קצרה בנוגע לנתוני התבנית. אם בויקי שלכם יש הודעה כזו, הוסיפו אותה אחרי הכותרת.

כדי להתחיל להוסיף נתוני תבנית, הקלד תגית פתיחה וסגירה של <templatedata> וזוג סוגריים מסולסלים בשורות חדשות, כאשר שורה ריקה ביניהם:

<templatedata>
{

}
</templatedata>

לאחר מכן, הוסף כניסה בשורה הריקה בין שני הסוגריים המסתלסלים, והתחל להוסיף פרמטרים. פרטים על הפרמטרים ניתן למצוא בכתובת #פרמטרים של נתוני תבנית. רובם אופציונליים; חלקם מומלצים מאוד.

הפרמטרים יכולים להיות בכל סדר, אך להלן הסדר המתאים ביותר לתיעוד נתוני התבנית והופך את התוכן לקל ביותר לשימוש עבור עורכים:

<templatedata>
{
    "description": "",
    "format": "",
    "params": {
        "parameter1": {
            "aliases": ["",""]
            "label": "",
            "description": "",
            "type": ""
        }
    },
    "paramOrder": [
    	""
    ]
}
</templatedata>

ודא שהפרמטרים, לדוגמה, באובייקט "params", נשארים בתוך אותו אובייקט; אחרת תפעיל שגיאת "מאפיין בלתי־צפוי "propertyname"." כשתנסה לשמור.

לדוגמה

הנה כמה דוגמאות לנתוני תבנית עבור תבנית ניקוי היפותטית. תבנית כזו תציג הודעה ותמקם את הדף בקטגוריה מתוארכת בהתבסס על החודש והשנה שהוזנו. ההודעה עשויה להכיל גם קישור לקטע בדף שיחה. נתוני התבנית ייראו בערך כך:

<templatedata>
{
	"description": "השתמש בתבנית זו כדי לציין שערך זקוק לניקוי.",
	"format": "inline",
	"params": {
		"date": {
			"label": "חודש ושנה",
			"description": "החודש והשנה שבהם נוספה התבנית",
			"type": "string",
			"autovalue": "{{SUBST:CURRENTMONTHNAME}} {{SUBST:CURRENTYEAR}}",
			"example": "ינואר 2013",
			"suggested": true
		},
		"reason": {
			"aliases": ["1"],
			"label": "סיבה",
			"description": "הסיבה שהערך זקוק לניקוי",
			"type": "string"
		},
		"talk": {
			"aliases": ["קטע שיחה"],
			"label": "קטע בדף שיחה",
			"description": "החלק של דף השיחה המכיל דיון רלוונטי",
			"type": "string"
		}
	},
	"paramOrder": [
		"date",
		"reason",
        "talk"
	]
}
</templatedata>

תיעוד נתוני התבנית המתאים יוצג כך:

השתמש בתבנית זו כדי לציין שערך זקוק לניקוי.

Template parameters

This template prefers inline formatting of parameters.

ParameterDescriptionTypeStatus
חודש ושנהתאריך

החודש והשנה שבהם נוספה התבנית

Example
ינואר 2013
Auto value
{{SUBST:CURRENTMONTHNAME}} {{SUBST:CURRENTYEAR}}
Stringsuggested
סיבהסיבה 1

הסיבה שהערך זקוק לניקוי

Stringoptional
קטע בדף שיחהשיחה קטע שיחה

החלק של דף השיחה המכיל דיון רלוונטי

Stringoptional

פרמטרים של נתוני תבנית

כל פרמטרי נתוני התבנית הזמינים (כלומר, אלו שבין התגים <templatedata>...</templatedata> של מקור הויקי) מפורטים להלן עם תיאור ודוגמה. הם רשומים גם בפירוט טכני יותר ב-Extension:TemplateData#Format.

  • מידע זה עדכני נכון לנובמבר 2021 ועשוי להשתנות אם יתווספו פרמטרים חדשים או שממשקי עריכת התבניות יקבלו עדכונים כדי לתמוך בפרמטרים קיימים או להתייחס לפרמטרים מסוימים בצורה שונה.
  • סימון ויקי לא יעבוד בתיאורים או בתוויות. אלו מחרוזות טקסט רגילות לחלוטין.
  • שורות חדשות ("\n") בתיאורים, תוויות, דוגמאות או ברירות מחדל לא יופיעו באף אחד מהעורכים הראשיים (TemplateWizard, העורך החזותי או עורך ה-wikitext משנת 2017), למרות שהן מופיעות בתיעוד נתוני התבנית שנוצר אוטומטית. הם מוחלפים במחרוזת null בטפסי קלט וברווח במקומות אחרים.
פרמטר תיאור דוגמה
description

הפרמטר "description" שמתאר מה התבנית עושה. זה אופציונלי, אבל מומלץ מאוד.

השפעות

בדף תיעוד התבנית, התיאור יוצג בטקסט רגיל מתחת לכותרת המשנה "נתוני תבנית עבור [שם תבנית]".

בכל העורכים הראשיים (VisualEditor, עורך קוד מקור 2017 ו-WikiEditor עם TemplateWizard), התיאור מופיע בשני מקרים עיקריים:

  • מתחת לשם התבנית בכל הצעת חיפוש כאשר המשתמש מחפש תבנית
  • מתחת לשם התבנית בעורך התבניות, בזמן שהם מוסיפים ערכים לפרמטרים בתבנית.

בעורך החזותי ובעורך הויקיטקסט משנת 2017, התיאור מקוצר לכ-50 תווים מתחת לכל הצעת חיפוש, ואחריו מופיע "...", אך התיאור המלא מוצג בחלון עורך התבניות הראשי. שניהם מוצגים בטקסט אפור.

בחלון הראשי של עורך התבניות, תיאורים הארוכים מארבע שורות (כ-540 תווים) מקבלים פס גלילה נפרד, והם מוצגים בטקסט שחור.

אם לא צוין

אם פרמטר התיאור אינו קיים או לא צוין, הטקסט אין תיאור. יוצג בתיעוד נתוני התבנית מתחת לכותרת המשנה "נתוני תבנית עבור [שם תבנית]". בנוסף:

  • בעורך החזותי ובעורך הויקיטקסט של 2017, הוא יתנהג כמו תבנית שאין לה נתוני תבנית; במקום תיאור, יוצג הטקסט הבא:
"לתבנית "Template:Templatename" עדיין אין תיאור, אך ייתכן שיש מידע כלשהו בדף התבנית."
  • בעורך הטקסט של ויקי משנת 2010 עם TemplateWizard, הטקסט הבא יוצג במקום בו התיאור יהיה (למעט בהצעות חיפוש):
"לא קיים תיאור עבור תבנית זו."
זה שונה משני תיאורי המיקום הסטנדרטיים במקרים בהם נתוני תבנית אינם קיימים:
  • "עקב נתוני תבנית חסרים, פרמטרים עבור תבנית זו נוצרו אוטומטית. שימו לב שייתכן שהם אינם מדויקים."
  • "לא ניתן היה לקבוע פרמטרים עבור תבנית זו עקב היעדר תיעוד נתוני תבנית. ניתן להכניס את התבנית ללא פרמטרים."
"description": "תבנית לקישור לקטגוריה בויקישיתוף",
format

הפרמטר "format" מתאר כיצד יש לעצב את קוד הויקי של התבנית. ניתן להגדיר זאת לפורמטים הסטנדרטיים של "inline" ו-"block", או שהמשתמש יכול להזין קבוצה של סמלי ויקיטקסט כדי ליצור פורמט מותאם אישית; סמלים אלה וכמה דוגמאות מפורטים בסעיף #פורמטים מותאמים אישית.

פרמטר זה אינו חובה, אך מומלץ. אופן הפעולה המוגדר כברירת מחדל כאשר פרמטר זה אינו מסופק הוא שימור העיצוב הקיים עבור פרמטרים קיימים, או עיצוב מוטבע עבור פרמטרים ותבניות שנוספו לאחרונה.

השפעות

קו מוטבע: ("inline")

לאחר הוספת התבנית, היא תפרס את הטקסט הויקי שלה בשורה אחת ללא רווח לבן בין האלמנטים, כך:

{{Foo|bar=baz|longparameter=quux}}

בלוק: ("block")

לאחר הוספת התבנית, היא תפזר את הפרמטרים שלה בשורה חדשה, עם רווחים בודדים בין כל אלמנט, כך:

{{Foo
| bar = baz
| longparameter = quux
}}

עיצוב מותאם אישית:

לחלופין, אם הפרמטר מוגדר למחרוזת ויקיטקסט מותאמת אישית, בהתאם לכללים המפורטים ב-#פורמטים מותאמים אישית, התבנית תעצב את ויקיטקסט שלה בהתאם לויקיטקסט הנתון.

"format": "inline"
params

האובייקט "params" מכיל את המידע של כל הפרמטרים של התבנית. זה נדרש, וניתן לראות את הפרמטרים שלו בסעיף #Within params.

עליו להכיל את השם של כל פרמטר ואחריו קבוצה של תת-פרמטרים של נתוני תבנית המפורטים תחת #בתוך שם הפרמטר.

אם יש פרמטרים מרובים, הצב פסיק בין לכל אובייקט פרמטר, אך אל תוסיף אחד אחרי הסוגר המתולתל האחרון (ראה דוגמה).

"params": {
    "parameter1": {
        ...    // מידע על הפרמטרים
    },      // פסיק כאן
    "parameter2": {
        ...    // מידע על הפרמטר
    },      // וכאן
    "parameter3": {
        ...    // מידע על הפרמטר
    }       // אבל לא פה
}
paramOrder

האובייקט "paramOrder" הוא אובייקט אופציונלי שגורם לפרמטרים של תבנית להופיע בסדר מסוים בעת הוספתם לעורך התבניות.

איך להשתמש

Add the parameter "paramOrder", followed by a colon, a space and an open square bracket, then type the name of each of the template's parameters in double quotation marks (") in the desired order, separated by commas. End with a closed square bracket (creating an array).

The parameters need not be on new lines (they may be written as "paramOrder": ["param1","param2","param3"]), but placing them on new lines often helps readability.

We recommend you place "paramOrder" after "params", as the template data editor does; it isn't displayed in the template data documentation but simply forces the order of the parameters. A future editor may wish to quickly look through the parameter details and edit them rather than scrolling past the "paramOrder", especially if there are a lot of parameters. If you do choose to place paramOrder somewhere besides the end of the template data, end it with a comma.

You must include every parameter mentioned in the template data; otherwise a "המאפיין הדרוש "propertyname" לא נמצא." error will show.

If not specified

Without "paramOrder", the template's parameters will display in the order in which the template's source code declares them. If the source code contains objects inside objects, the parameters in outer objects will come first, followed by inner objects.

With other parameters

In the 2010 wikitext editor with TemplateWizard:

  • "required" parameters always appear at the top, regardless of the order in "paramOrder".
  • "suggested" parameters will always appear second, above "optional" ones.
  • "deprecated" parameters won't appear at all in this editor; see the description of "deprecated" for more info.
  • "paramOrder" will only enforce its order within these categories (i.e., all "required" parameters will be in the order specified by "paramOrder", and all "suggested" parameters will be too, but all "suggested" parameters will appear below all "required" parameters).

In the visual editor and the 2017 wikitext editor, "paramOrder" forces its order regardless of the status of each parameter.

"paramOrder": [
	"date",
	"reason",
	"talk"
]

בתוך params

פרמטר תיאור דוגמה
שם הפרמטר

הפריט היחיד ברמה הראשונה של האובייקט params הוא השם של פרמטר של התבנית.

For example, in a template's source code, {{{date}}} denotes a parameter, and it should be added under "params" with the name "date".

You may also see parameters named {{{1}}} or another number (whose template data name should be, for example, "1"). Parameters like this prevent a user inserting a template from having to type the parameter name and the equals sign (i.e., |value| instead of |parametername=value|). When there are multiple unnamed parameters, the number identifies which unnamed parameter is being referred to. For example, in:

{{example template|value1|value2}}

value1 is the value of parameter {{{1}}}, and value2 is the value of parameter {{{2}}}. Describe your template data parameters accordingly.

Note: a user can still force the use of {{{2}}} without {{{1}}} by inserting a parameter named "2" in the template editor or typing "|2=" in wikitext. Finally, note that "aliases" creates alternatives to the parameter name which can be used interchangeably, and "label" replaces the parameter name in the user interface with the specified label (for situations in which the parameter name is not human readable or easily understood).

How to use

Each of these שם הפרמטר objects should contain all of the information about the parameter, in the form of more template data parameters. These are listed in the following section, Within a parameter's name.

"1": {     // שם הפרמטר
    ...    // מידע על הפרמטר יופיע כאן
}

בתוך שם הפרמטר

פרמטר תיאור דוגמה
aliases

The optional "aliases" parameter allows a template parameter to have multiple names. You can check this by going into the template's source code and looking for:

{{{parameter1|{{{parameter2}}}}}}

או

{{{parameter1|{{{parameter2|}}}}}}

This means that if the user inserts either of these parameters with a value, they will perform the same function. Literally, it translates to, "Value of parameter1. If parameter1 doesn't exist or have a value: value of parameter2." In the second case, it also means, "If parameter2 doesn't exist or have a value: no value."

To insert the "aliases" parameter, add the text "aliases" followed by a colon, a space and an open square bracket, then typing the name of each of the parameter's aliases in quotation marks, separated by commas. End with a closed square bracket, creating an array.

"aliases": ["1", "talk", "talksection"],
inherits

"inherits" is an optional parameter for when a parameter should inherit all of the template data of another parameter. This can then be overridden by any parameters specified for the inheriting parameter.

To use this parameter, type "inherits" : followed by another template parameter's name, such as "talk" or "1". You can then type another specific setting for the parameter underneath if you wish, like "label" : "A different label". The first parameter will inherit all of the second parameter's properties except this one.

    "params": {
        "נושא1": {
            "label": "נושא",
            "description": "נושא שמוזכר בדף הפירושונים הזה",
            "type": "string"
        },
        "נושא2": {
            "inherits": "נושא1"
        },
        "נושא3": {
            "inherits": "נושא1",
            "label" : "A different label"
        }
    }
label

לאחר מכן יש "label", בו יש לכתוב כותרת ברורה וקריאה לפרמטר שתוצג בעורך התבניות. The label is displayed in place of the parameter's raw name at all times, including when an alias is used in the wikitext. This parameter is optional but highly recommended.

"label": "חודש ושנה",
description

הפעם "description" הוא תיאור הפרמטר, ולא תיאור התבנית כולה. This description appears below the parameter name (a long descriptions will be shortened with a button to optionally expand it). It is optional but highly recommended.

"description": "The month and year that the template was inserted",
type

See the #Type parameter section.

default

Some template parameters have a default value; the value is used unless overridden by the user. The "default" item is an optional item, documentary only, that is intended to communicate this default value to the user. The value need not match the actual default (if there is one) and has no functional effect. (Not to be confused with "autovalue", which is a functional parameter that fills in a field for the user.)

השפעות

In all main editors (the visual editor, the 2017 wikitext editor and the 2010 wikitext editor with TemplateWizard), the "default" text will show as grey text in the input box of any open parameter when it is empty, in the format "Default: default text". Additionally, it will show in plain black text in the parameter description (when the user hovers over the "i" symbol). In the visual editor and the 2017 wikitext editor, this will be below the parameter description, below "Field is required"/"Field is deprecated", if specified (the 2010 wikitext editor doesn't show this text), and above "example", if specified ("example" does not show in the parameter description in the 2010 wikitext editor). In the 2010 wikitext editor with TemplateWizard, the "default" text shows directly after the parameter description, on the same line, following a space. It shows in the same format as the other editors ("Default: default text").

עם פרמטרים אחרים

In all main editors (the visual editor, the 2017 wikitext editor and the 2010 wikitext editor with TemplateWizard), if "default" is specified, the "example" value will not show in the input box.

"default": "Category:CommonsRoot",
autovalue

ניתן להקצות לפרמטר "autovalue". When a user adds the template to a page, this value will automatically appear in the input box. For example, many cleanup templates need the date added; setting the "autovalue" for the template's date parameter to be {{subst:CURRENTMONTHNAME}} {{subst:CURRENTYEAR}}, the month and year that the template was added will be filled in automatically.

This value can be overwritten by the user in the template editor.

עם פרמטרים אחרים

In all main editors (the visual editor, the 2017 wikitext editor and the 2010 wikitext editor with TemplateWizard), "autovalue" overrides the visible effects of "url" in the visual editor and the 2017 wikitext editor. See the description for "type" for more info.

"autovalue": "{{subst:CURRENTMONTHNAME}} {{subst:CURRENTYEAR}}"
example

The "example" parameter is optional and documentary only; its value contains an example that helps the template's user understand the correct way to fill in the parameter (not to be confused with "suggested"; see that entry for more information).

השפעות

In all main editors (the visual editor, the 2017 wikitext editor and the 2010 wikitext editor with TemplateWizard), this property is displayed below the parameter description (and below the "default" text, if specified).

עם פרמטרים אחרים

In all main editors (the visual editor, the 2017 wikitext editor and the 2010 wikitext editor with TemplateWizard), "example" will not show in the input box if "default" is specified.

"example": "January 2013",
suggested values

The parameter property suggestedvalues lets you define a list of parameter values to be shown to visual editor users in a dropdown for easy selection. This can be done either directly in JSON or using the template data editor (no coding required). You can add suggested values to be displayed in the visual editor for parameters which have their type set to one of the following options (reference):

  • תוכן
  • שורה
  • מחרוזת
  • מספר
  • לא ידוע
  • קוד ויקי בלתי־מאוזן

Other types (file, page, template, user, date, boolean, URL) are not currently supported because they have special functionalities in the visual editor already, such as autocomplete, which would interfere with the drop-down menu for suggested values in the visual editor.

Editing template data as JSON in wikitext

To add suggested values to any parameter type, add the new property "suggestedvalues" to the parameter in JSON. The “suggestedvalues” attribute must be a list of strings.

Editing template data with the template data editor

  1. Click on עריכת נתוני תבנית.
  2. Click on the name of the parameter you want to add suggested values to.
  3. If it’s not already done, set parameter type to one of the following: content, line, string, number, unknown, unbalanced wikitext. A new input field ערכים מוצעים will appear. If the parameter is already set to one of these types, the input field should already be visible.
  4. Type in the suggested value(s), including any spaces and special characters, and press enter to add the value(s) to the list.

השפעות

Once the values have been added to template data, the visual editor will display them in a combo box (a dropdown into which users can also enter a custom value) for the parameter types listed above. The user selects the desired value by clicking on it. If the list of values is long -- for example, a list of a country’s states -- the user can begin typing in the field, whereupon the list will be filtered to show only values containing the typed text. To change an entered value, the user must simply clear the field, and the full dropdown list will appear again. If the user needs a value not included in the list (for example, "message in a bottle") they can type it in manually.

	"suggestedvalues": [
		"כתב עת",
		"ספר",
		"עיתון",
		"מגזין"
	]
אפשרות סטטוס תיאור דוגמה
required

ניתן להגדיר את הפרמטר "required" ל-true או false. כאשר לא מצוין, הערך מוגדר כברירת מחדל ל-false.

הוא קובע אם מילוי הפרמטר הנתון הוא חובה עבור התבנית.

השפעות

לסטטוס זה יש מספר השפעות בעורך הוויזואלי וב-עורך קוד מקור 2017:

  • it displays the parameter automatically when a user inserts the template;
  • it shows a black asterisk within the input box, on the right;
  • it shows the grey, italic text השדה נדרש. below the parameter description;
  • it makes the input box glow red if the user clicks away without entering a value;
  • if a user attempts to insert the template without a value in the required parameter, it will show them a prompt, asking if they are sure. If they confirm, it will insert the parameter with a blank value. It will not stop them from inserting the template, though, and it does not result in a visible error by itself (though templates can be programmed to display an error when a required parameter is not filled in).

In the WikiEditor with Extension:TemplateWizard, as in the other editors, it displays the parameter automatically when a user inserts the template, but the parameter cannot be removed using this or any editor. It also does not display השדה נדרש. in the parameter description; rather, it lists the parameter on the side under פרמטרים נדרשים. Other than this, it generally behaves the same as in the other editors, except that the prompt says that the input doesn't "match the expected format".

עם פרמטרים אחרים

In the visual editor and the 2017 wikitext editor, the "deprecated" status does not override the functionality of this parameter, but in the 2010 wikitext editor with TemplateWizard it does. ראה את התיאור של "deprecated" למידע נוסף.

"required": true
suggested

הפרמטר "suggested" גם יכול להיות או true או false. כאשר לא מצוין, ברירת המחדל היא false.

Use "suggested" for parameters that are not mandatory but strongly recommended for template users to provide. When filling in this parameter, a user will see this suggestion.

Effects

In the visual editor and the עורך קוד מקור 2017, it causes the parameter to automatically show up when a user inserts a template. If the parameter has an autovalue set, this will also automatically be in the parameter's input box. It has no other effect and doesn't show any additional text or warnings.

In the WikiEditor with TemplateWizard, it does not place the parameter in the template automatically but instead causes it to be listed on the side under פרמטרים מוצעים. The user can then click a "+" next to the parameter to add it to the template.

עם פרמטרים אחרים

The "required" status overrides the functionality of this status in all main editors (the visual editor, the 2017 wikitext editor and the 2010 wikitext editor). It also overrides the displayed "suggested" status in template data documentation (it will display "required" if both "required" and "suggested" are set to true).

"suggested": true
deprecated

לסיום ישנו "deprecated" שיכול להיות true, false או כל מחרוזת שמתארת מה המשתמש צריך לעשות במקום. כאשר לא מצוין, ברירת המחדל היא false.

הבחירה הזאת מיועדת לפרמטרים שאינם נמצאים בשימוש, אך עדין קיימים. זה יכול לקרות בגלל שינוי שמות פרמטרים בתבנית, למשל.

השפעות

The effect of this parameter in the visual editor and the 2017 wikitext editor is that a grey exclamation mark shows next to the parameter's label when it is inserted, and in the parameter's information tooltip, the grey, italic text "השדה מיושן. deprecation reason" is shown below the parameter description. It does not affect the functionality or usability of the parameter or show any additional warnings.

Despite the fact that it can take a string, as of January 2020 none of the main editors (the visual editor, the 2017 wikitext editor or the 2010 wikitext editor) display the contents of the string anywhere to users. Inputting a string has the same effect as true.

In the 2010 wikitext editor with TemplateWizard, setting this value as true does not allow the parameter to be added or seen.

עם פרמטרים אחרים

If you set both this and "suggested" as true, the parameter status will show as "deprecated" in the template data documentation, but in the visual editor and the 2017 wikitext editor both functionalities will be retained; the parameter will automatically show up when a user inserts a template, but it will have the "deprecated" warnings around it.

If you set both this and "required" as true, the parameter status will show as "deprecated" in the template data documentation, but in the visual editor and the 2017 wikitext editor it will have the same functionality as only "required"; the parameter will automatically show up when a user inserts a template, and it will have the "required" warnings around it. This is the same for if you set "deprecated", "suggested" and "required" as true.

In the 2010 wikitext editor with TemplateWizard, "deprecated" overrides the parameters "required" and "suggested".

"deprecated": "Please use 'publicationDate' instead."

Note: if neither "required", "suggested" nor "deprecated" are set as true for a parameter, its status will show as "optional" in the template data documentation.

בסיום יש ללחוץ על שמירה. אם נעשו טעויות, לא תתאפשר שמירה (לפעמים זה מטריד אבל לפחות לא ניתן להרוס הכל). אם יש שגיאות, ניתן להסביר בדף המשוב מה ניסיתם לעשות ונשמח לעזור.

Note that if you are abusing a hack template to dynamically generate template data, it cannot be checked for errors before saving.

שימו לב שכל פריט מידע מוקף במרכאות (למעט true ו-false) ומופרד מהפריט הבא בפסיק (חוץ מהנתון האחרון).

סוג הפרמטר

הפרמטר "type" נועד לאותת לעורך תבנית את אופי הערך של פרמטר. In some cases, template editors have been programmed to modify the user interface for a certain parameter according to this template data value, such as to only allow the user to enter valid values that match the specified type. This parameter does not have any functional effect on the template parameter or its value; it merely controls how template editors see and treat the parameter in editing mode.

כיצד להשתמש

It is used by adding the "type" parameter, followed by a colon and a space, then adding any of the values listed in the table below in quotation marks.

דוגמה:

"type": "string",

השפעות

As of February 2020, only 5 of the 13 type values have visible effects in VisualEditor and the 2017 wikitext editor, while 8 have visible effects in TemplateWizard.

The effects of certain values are likely to change as the template editors get updates to support them. One such effort for VisualEditor and the 2017 wikitext editor is tracked in the Phabricator task T55613. A similar effort to get TemplateWizard to support the boolean value is tracked in T200664.

The currently known effects are listed as follows.

ערך תיאור
unknown

The "unknown" value is the default type value if no type is set. It can also be set manually by typing "type": "unknown".

השפעות

In all main editors (VisualEditor, 2017 wikitext editor and the 2010 wikitext editor with TemplateWizard), "unknown" has no visible effects compared to a template without template data.

string

The "string" value is intended for any string of plain text.

השפעות

In all main editors (the visual editor, the 2017 wikitext editor and the 2010 wikitext editor with TemplateWizard), "string" has no visible effect compared to "unknown".

line

The "line" value is intended for content that should be forced to stay on one line.

השפעות

  • In the visual editor and the 2017 wikitext editor, "line" prevents a parameter's input box from allowing new lines, which are usually possible in these editors.
  • In the 2010 wikitext editor with TemplateWizard, "line" has no visible effect (input boxes do not allow new lines by default in this editor).
content

The "content" value is intended for wikitext of page content, for example, links, images or text formatting.

השפעות

  • In the visual editor and the 2017 wikitext editor, "content" has no visible effect.
  • In the 2010 wikitext editor with TemplateWizard, "content" makes the parameter input box one line taller and allows new lines, which regular input boxes in the 2010 wikitext editor do not.
unbalanced-wikitext

The "unbalanced-wikitext" value is intended for wikitext that cannot stand alone, i.e. it lacks an opening or closing tag or refers to other parts of wikitext.

השפעות

  • In the visual editor and the 2017 wikitext editor, "unbalanced-wikitext" has no visible effect.
  • In the 2010 wikitext editor with TemplateWizard, "unbalanced-wikitext" makes the parameter input box one line taller and allows new lines, which regular input boxes in the 2010 wikitext editor do not.
wiki-page-name

The "wiki-page-name" value is intended for a page name on a wiki.

השפעות

In all main editors (the visual editor, the 2017 wikitext editor and the 2010 wikitext editor with TemplateWizard), "wiki-page-name" makes the parameter input box show a suggestion dropdown menu containing a list of pages on the wiki, such as articles on Wikipedia, which can be selected. Namespaces can also be defined in the search. Additionally, in the visual editor and the 2017 wikitext editor, it forces the input box content to stay on one line. It has no other visible effect and doesn't prevent a non-page from being inputted.

wiki-file-name

The "wiki-file-name" value is intended for a file name hosted either locally on a wiki or on Wikimedia Commons.

השפעות

  • In the visual editor and the 2017 wikitext editor, "wiki-file-name" has no visible effect.
  • In the 2010 wikitext editor with TemplateWizard, "wiki-file-name" makes the parameter input box show a suggestion dropdown menu containing a list of files hosted both locally and on Wikimedia Commons, which can be selected.
The file names do not contain the "File:" namespace prefix. The dropdown menu also shows the thumbnail of the files. It has no other visible effect and doesn't prevent a non-file from being inputted.
wiki-template-name

The "wiki-template-name" value is intended for the name of a template.

השפעות

In all main editors (the visual editor, the 2017 wikitext editor and the 2010 wikitext editor with TemplateWizard), "wiki-template-name" makes the parameter input box show a suggestion dropdown menu containing a list of templates, which can be selected. Additionally, in the visual editor and the 2017 wikitext editor, it forces the input box content to stay on one line. It has no other visible effect and doesn't prevent a non-template from being inputted.

wiki-user-name

The "wiki-user-name" value is intended for a username on a wiki.

השפעות

In all main editors (the visual editor, the 2017 wikitext editor and the 2010 wikitext editor with TemplateWizard), "wiki-user-name" makes the parameter input box show a suggestion dropdown menu containing a list of actual users' names, which can be selected. Additionally, in the visual editor and the 2017 wikitext editor, it forces the input box content to stay on one line. It has no other visible effect and doesn't prevent a non-username from being inputted.

number

The "number" value is intended for numerical values, including negative values and decimals.

השפעות

  • In the visual editor and the 2017 wikitext editor, "number" has no visible effect.
  • In the 2010 wikitext editor with TemplateWizard, "number" causes the input box to display a "+" and "-" button on either side, which can raise or lower a number value in the input box, and the user can only type numbers into the box.
The buttons can also lower the number into negatives.

עם פרמטרים אחרים

  • In the 2010 wikitext editor with TemplateWizard, "number" overrides the effects of "autovalue"; the value of "autovalue" will not be automatically placed in the input box if the parameter type is "number".
boolean

The "boolean" value is intended for a value that is either true, false or unknown. This is intended by the manual to be represented by a "1", "0" or blank value.

השפעות

With the autovalue:0 checkbox appears in the visual editor, which can be switched on and off.

date

The "date" value is intended for a date in the YYYY-MM-DD (ISO 8601) format; for example, 2014-05-22. The template data manual also designates it as being intended for ISO 8601 date–time combinations, such as "2014-05-22T16:01:12Z", but in practice no major editing interface as of February 2020 uses it in this fashion, and almost all major Wikimedia template parameters take dates and times separately.

השפעות

  • In the visual editor and the 2017 wikitext editor, "date" has no visible effect.
  • In the 2010 wikitext editor with TemplateWizard, "date" makes the parameter input box about a third shorter and adds a dropdown calendar, allowing the user to choose a date input. It also displays the grey example text in the input box "YYYY-MM-DD". If an input does not conform to this standard, the box glows red, however the editor will always output a date conforming to the standard (if numbers are entered) or nothing (if only text or nothing is entered).

עם פרמטרים אחרים

  • In the 2010 wikitext editor with TemplateWizard, "date" overrides the effects of "autovalue"; the value of "autovalue" will not be automatically placed in the input box if the parameter type is "date".
url

The "url" value is intended for a URL, with Internet protocol (e.g., "https://" or "//") included.

השפעות

  • In the visual editor and the 2017 wikitext editor, "url" makes the input box display an external link icon (a square with arrow pointing out of it) in the left hand side of the box and makes the box glow red when the user clicks away without entering a URL value that includes a valid Internet protocol (e.g., "https://", "ftp://" or "//") followed by some text.
This second effect is similar to that of the "required" setting, but it does not warn the user if they attempt to insert the template without a valid URL. It also occurs with any status setting (such as "suggested"" or "deprecated").
  • In the 2010 wikitext editor with TemplateWizard, "url" has no visible effect.

עם פרמטרים אחרים

  • In the visual editor and the 2017 wikitext editor, "autovalue" overrides the visible effects of "url": when both are set, the input box will not contain a URL icon nor glow red when the user clicks away without entering a valid URL.

פורמטים מותאמים אישית

When editing the "format" value, you create custom formats by inputting a set of wikitext symbols using some predefined rules.

  • {{ - תחילת התבנית
  • _ - תוכן (למשל, מחרוזת, מספר שלם או פרמטר). This underscore serves to indicate the minimum length of a value in characters and can be repeated, like _______. If this length is not reached, it fills the remaining characters with spaces. This can be used to align all equals signs to a specific position after a parameter (if used with \n for new lines).
  • | - pipe (separates parameters)
  • = - equals sign (precedes the value of a parameter)
  • \n or pressing the enter key - new line (this will display as in the entry field)
  • - space (can be used with \n to indent new lines)
  • }} - סוף התבנית

The wikitext should at least meet the minimum of {{_|_=_}}, otherwise there will be an invalid format string error.

דוגמאות לפורמטים בהם ניתן להשתמש
מטרה עיצוב מחרוזת פלט
עיצוב מוטבע {{_|_=_}}
inline
{{Foo|bar=baz|longparameter=quux}}{{Bar}}
עיצוב בלוקים {{_\n| _ = _\n}}
block
{{Foo
| bar = baz
| longparameter = quux
}}{{Bar}}
No space before the parameter name, each template on its own line \n{{_\n|_ = _\n}}\n
{{Foo
|bar = baz
|longparameter = quux
}}
{{Bar}}
Indent each parameter {{_\n |_ = _\n}}
{{Foo
 |bar = baz
 |longparameter = quux
}}{{Bar}}
Align all parameter names to a given length {{_\n|_______________ = _\n}}\n
{{Foo
|bar            = baz
|longparameter  = quux
|veryverylongparameter = bat
}}
{{Bar}}
Pipe characters at the end of the previous line {{_|\n _______________ = _}}
{{Foo|
  bar            = baz|
  longparameter  = quux}}{{Bar}}
Inline style with more spaces, must be at start of line \n{{_ | _ = _}}
{{Foo | bar = baz | longparameter = quux}}
{{Bar }}
Template at the start of a line, indent-aligned parameters, pipe beforehand \n{{_ |\n _______________ = _}}
{{Foo |
  bar            = baz |
  longparameter  = quux}}
{{Bar}}

מבנה ריק

ניתן להעתיק את המבנה הריק שלהלן על מנת להוסיף נתוני־תבנית לתבנית. רק התגים הנפוצים ביותר נכללים בו.

<templatedata>
{
    "description": "",
    "params": {
        "1": {
            "label": "",
            "description": "",
            "type": ""
        },
        "2": {
            "label": "",
            "description": "",
            "type": ""
        }
    }
}
</templatedata>

שגיאות

שגיאת תחביר ב־JSON. / פורמט JSON שגוי

These errors occur when saving template data, usually manually edited, with invalid JSON code (duplicate keys/parameters, trailing or missing commas, etc.) in the visual editor or the 2017 wikitext editor.

שגיאת תחביר ב־JSON. appears in the visual editor and the 2017 wikitext editor; "Bad JSON format" appears when editing in the template data GUI editor.

These errors can be difficult to detect and come in too many forms to list. The best way to avoid them is to edit template data exclusively with the template data editor; the best way to detect them once they've occurred is to use an external JSON validator, such as JSONLint, which will highlight errors and aid in fixing them.

The 2010 wikitext editor does not check for invalid JSON thanks to an old, unfixed bug (T128029). Pages that contain invalid JSON may throw alarming שגיאה פנימית messages. To fix these errors, your best bet is to use a JSON validator (see above).

המאפיין הדרוש "paramOrder[מספר]" לא נמצא.

שגיאה זו מתרחשת אם אתה מציין פרמטר ב-"params" שאינו מצוין ב-"paramOrder". The number in the square brackets refers to the parameter in "paramOrder" that is missing. It refers to its order in the sequence, but it is one less than its actual position, since "paramOrder" is an array; 0 is the first one, 1 is the second, etc.

"params": {
    "date": { ...
    },
    "reason": { ...
    },
    "talk": { ... // <-- This parameter is not stated in "paramOrder", but it should be.
    }
},
"paramOrder": [
	"date",
	"reason"
]

// Error: Required property "paramOrder[2]" not found.

To fix this, make sure all parameters stated in "params" are listed in "paramOrder". Alternatively, you can remove the "paramOrder" object to remove this error.

ערך בלתי־תקין למאפיין "paramOrder[מספר]".

שגיאה זו מתרחשת אם אתה מציין פרמטר ב-"paramOrder" שאינו מצוין ב-"params". The number in the square brackets refers to the parameter in "paramOrder" that shouldn't be there. It refers to its order in the sequence, but it is one less than its actual position, since "paramOrder" is an array; 0 is the first one, 1 is the second, etc.

"params": {
    "date": { ...
    },
    "talk": { ...
    }
},
"paramOrder": [
	"date",
	"reason", // <-- This parameter is not stated in "params", but it should be.
    "talk"
]

// Error: Invalid value for property "paramOrder[1]".

To fix this, make sure all parameters stated in "paramOrder" are listed in "params". Alternatively, you can remove the "paramOrder" object to remove this error.

המאפיין "params.parametername.required" אמור להיות מסוג "boolean".

This error occurs if you put quotation marks around the value of either "required" or "suggested".

"suggested": "true" // <-- These quotation marks shouldn't be here.

These are boolean values, not strings, therefore they require no quotation marks. To fix this, remove any quotation marks around the values true or false for these parameters.

המאפיין "format" צפוי להיות ...

If the "format" parameter exists but its value is not "inline", "block" or a valid format string, you will see the error message המאפיין "format" אמור להיות "inline" (בשורה) או "block" (בפסקה), או מחרוזת עיצוב תקינה..

"format": "notinline"

// Error : Property "format" is expected to be "inline", "block", or a valid format string.

To fix this, make sure the value after "format": equals "inline" or "block" and that there no spelling mistakes. Alternatively, if it's wikitext, make sure it contains a minimum of {{_|_=_}} and that there are no mistakes in the syntax that would normally cause a template to fail, such as duplicate equals signs or missing/duplicate curly brackets; see the section #Custom formats for the syntax for custom formats. Alternatively, you can remove the "format" parameter to remove this error.

מאפיין בלתי־צפוי "parametername".

This error occurs if you state a parameter that is unknown in template data. This is probably due to spelling mistakes or the use of uppercase letters instead of lowercase.

<templatedata>
{
    "description": "",
    "format": "inline",
    "params": {
        "1": {
            "label": "",
            "descriptino": "", // <-- spelling mistake
            "type": ""
        }
    }
}
</templatedata>

It also occurs if you state a parameter in any template data object that is not a parameter of that object. This may be due to spelling mistakes, or you may have written the parameter of one template data object under another object that it doesn't belong to.

For example, you might have written the parameter "label" under the root template data object instead of inside "params":

<templatedata>
{
    "description": "",
    "format": "inline",
    "label": "", // <-- incorrectly placed parameter
    "params": {
        "1": { // ↓ it should be in here
            "description": "",
            "type": ""
        }
    }
}
</templatedata>

Alternatively, if the unexpected parameter is under a template parameter inside "params", you'll see its name after "params.parametername." in the error.

To fix this, make sure there aren't any spelling mistakes in the parameter names, and make sure your parameters are in their correct location. Additionally, make sure you don't state any parameters that don't exist for a template data object. You can check which parameters exist for an object in the section #Template data parameters.

המאפיין הדרוש "params" לא נמצא.

This error occurs if there is no "params" object in the template data. This is a necessary object, as it contains all the details of each parameter, so to fix this error, make sure it's added and that there are no spelling mistakes. See the section above on how to add the "params" parameter.

הגבלות ותגובות

  • פונקציונליות חסרה – נתוני תבנית הוא דוגמה לכלי שנוצר עם מספר פונקציות קטן בתקווה שהמשתמשים ינתבו את צוות הפיתוח לפונקציונליות נוספת שהם מעוניינים בה. אם יש לכם בקשה לפונקציונליות חדשה עבור נתוני תבנית, נא ידעו אותנו.
  • עיכוב בהצגת מידע בתבניות – כאשר מוסיפים נתוני תבנית לתבנית, הנתונים צריכים להופיע מיידית כאשר פותחים את התבנית בעורך החזותי. אולם לעיתים קורה שלוקח כמה שעות לפני שנתוני התבנית מוצגים. ניתן לכפות את העדכון על ידי ביצוע עריכה ריקה של דף התבנית (ולא לדף המשנה עם התיעוד). על מנת לעשות עריכה ריקה יש לפתוח את הערך לעריכה ולשמור ללא ביצוע שום שינוי וללא תקציר עריכה.
  • בעיות פתוחות – רשימת בעיות פתוחות ובקשות לתכונות נוספות ניתן לראות במעקב בבאגים של ויקימדיה.

כלים נוספים

Help:Extension:TemplateWizard
חלון דו-שיח בסרגל כלים להזנת טקסט ויקי של תבנית באמצעות טופס שנבנה מנתוני תבנית.
TemplateData Wizard
כלי שיוצר נתוני תבנית דרך ממשק אינטרקטיבי.
Skeleton TemplateData generator
כלי שקורא את הקוד של התבנית, מנסה למצוא את כל הפרמטרים ויוצר מסמך שלדי עם רשימת הפרמטרים.
JSONLint
כלי המאפשר לאשר JSON כתוב בצורה ידנית על מנת לסייע לאתר שגיאות בקוד.