ទំព័រគំរូ:ប្រអប់ព័ត៌មាន/doc

ពីវិគីភីឌា

ទំព័រគំរូដោយចេតនាជាទំព័រគំរូមេតា: ទំព័រគំរូដែលប្រើសម្រាប់សង់ទំព័រគំរូឯទៀត។ វាមិនមានន័យថាសម្រាប់ប្រើដោយផ្ទាល់ក្នុងអត្ថបទនោះទេ តែអាចប្រើបានលើជំហរតែមួយដងបើត្រូវបានទាមទារ។ មើលជំនួយ:ប្រអប់ព័ត៌មាន សម្រាប់លំណែនាំនៃប្រអប់ព័ត៌មាន និងព័ត៌មាន អំពីរបៀបកែច្នៃវា។ មើលចំណាត់ថ្នាក់ក្រុម:ទំព័រគំរូ ប្រអប់ព័ត៌មាន សម្រាប់ទំព័រគំរូប្រអប់ព័ត៌មានជាក់លាក់។

ការ​ប្រើ​ប្រាស់[កែប្រែ]

ការ​ប្រើប្រាស់​មាន​លក្ខណៈ​ស្រដៀង​ទៅ​នឹង {{navbox}}, ប៉ុន្តែ​គ្រាន់​តែ​ពុម្ព​គម្រូ​នេះ​មានភ្ជាប់​មក​ជាមួយ​នូវ ភាព​ខុស​គ្នា​បន្ថែម​ទៀត។ នៅ​ក្នុង​ជួរ​និមួយៗ​នៅ​លើ​តារាង អាច​មាន​ទាំង បឋមកថា, ឬ ស្លាក/ទិន្នន័យ, ឬ តែ​ទិន្នន័យ។ មាន​ភាព​ភាពមិន​ចុះ​សម្រុង​គ្នា ដូច្នេះ​ប្រសិន​បើ​អ្នក​កំណត់​ជួយ​មួយ​ជាមួយ​នឹង បឋមកថា និង ស្លាក/ទិន្នន័យ នោះ ស្លាក/ទិន្នន័យ នឹង​មិន​ស្គាល់។

ដើម្បី​បញ្ចូល​រូប​ភាព​ទៅ​ក្នុង​ទី​តាំង​ផ្សេង​ក្រៅប​ពី​កន្លែង​នៅ​ខាង​លើ ប្រអប់​ព័ត៌មាន ឬ បញ្ចូល​ទៅ​ក្នុង​ទិន្នន័យ​នោះ អ្នក​អាច​ប្រើ​ជា​ជួរ ដែល​ដាក់​តែ​វាល​ទិន្នន័យ​បាន​ហើយ។

ទីលំដាប់[កែប្រែ]

ដើម្បី​ឲ្យ​មាន​ភាព​អាច​បត់​បែន​បាន នៅ​ពេល​គ្រោង​នៃ​ប្រអប់​ព័ត៌មាន​ត្រូវ​បាន​ប្ដូរនោះ វា​អាច​មាន​ប្រយោជន៍​នៅ​ពេល​កំពុង​អភិវឌ្ឍ​ប្រអប់​ព័ត៌មាន​ដោយ​មិន​ប្រើ​ភាព​ទាក់​ទង​គ្នា​រវាងជួរ បឋមកថា និង ស្លាក/ទិន្នន័យ។ ការ​វាស់​ស្ទង់​សម្រាប់​ជួរ​ថ្មី អាច​នឹង​ត្រូវ​បាន​បញ្ចូល​ទៅ​ខាង​ក្នុង​នៅ​ពេល​ខាងមុខ ដោយ​មិន​មាន​ការ​ប្ដូរ​លេខ​លំដាប់​ឡើយ។ ជា​ឧទាហរណ៍៖

|header3  = Section 1
|label5   = Label A
|data5    = Data B
|label7   = Label C
|data7    = Data C
|header10 = Section 2
|label12  = Label D
|data12   = Data D

ការ​វាស់​ស្ទង់[កែប្រែ]

មើល/ពិភាក្សា/កែ​តំណ​ភ្ជាប់[កែប្រែ]

name
ជា​ឈ្មោះ​ពុម្ព​ទំព័រ​គម្រូ​ដែល​តំណ​ភ្ជាប់ "មើល/ពិភាក្សា/កែ​ប្រែ" សំដៅ​ទៅ​រក។ អ្នក​អាច​ប្រើ {{subst:PAGENAME}}។ ប្រសិន​បើ​ការ​វាស់​ស្ទង់នេះ​ត្រូវ​បាន​លុប​នោះ តំណ​ភ្ជាប់ មើល/ពិភាក្សា/កែប្រែ នឹង​មិន​បង្ហាញ​ឡើង​ទេ។

ចំណង​ជើង[កែប្រែ]

អក្សរ​នៅ​ក្នុង​ទីតាំង​លើ ប្រអប់​ព័ត៌មាន
ចំណង​ជើង​ក្បាល​រង​របស់ ប្រអប់​ព័ត៌មាន
(ប្រអប់​ព័ត៌មាន​ទាំង​មូល​គឺ​ស្ថិត​នៅ​ទីនេះ)
អក្សរ​នៅ​ក្នុង​ប្រអប់​ព័ត៌មាន​ខាង​លើ
ចំណង​ជើង​ក្បាលរង​របស់ ប្រអប់​ព័ត៌មាន
ចំណង​ជើងក្បាល​រងបន្ទាប់​របស់ ប្រអប់​ព័ត៌មាន
(ប្រអប់​ព័ត៌មាន​ទាំង​មូល​គឺ​ស្ថិត​នៅ​ទីនេះ)

មាន​វិធី​ពីរ​ផ្សេង​គ្នា ដើម្បី​ដាក់​ចំណង​ជើង​ឲ្យ ប្រអប់​ព័ត៌មាន។ ទី១ មាន​ចំណង​ជើង​នៅ​ខាង​ក្នុង​ព្រំដែន​ប្រអប់​ព៌តមាន, ទី២ គឺ​ដាក់​វា​នៅ​ខាង​លើ។ អ្នក​អាច​ប្រើ​វិធី​ទាំង​ពីរ​នេះ​ក្នុង​ពេល​តែ​មួយ ប្រសិន​ជា​អ្នក​ចង់, ឬ​ប្រើ​តែ​មួយ​ក៏​បាន​ដែរ, ឬ​មិន​​ប្រើ (ការ​ធ្វើ​បែប​នេះ​មិន​បាន​ណែនាំ​ឲ្យ​ប្រើ​ទេ)។

title
ជា​អក្សរ​ដាក់​នៅ​ក្នុង​ទីតាំង​ខាង​លើ​តារាង/ប្រអប់។
above
ជា​អក្សរ​ដាក់​នៅ​ខាង​ក្នុង ផ្នែក​ខាង​លើ​តារាង/ប្រអប់។

មាតិកា​ដែល​អាច​ដាក់​បាន​តាម​ចិត្ត[កែប្រែ]

subheader, subheader2
ជា​ចំណង​ជើង​បន្ថែម​ដែល​ដាក់​នៅ​ចន្លោះ {{{title}}} និង {{{above}}}.
image, image2
ជា​រូបបង្ហាញ​នៅ​កំពូល​ពុម្ព​គម្រូ។ ប្រើ​រូបមន្ដ​រូប​ភាព​ពេញ​លេញ, ឧទាហរណ៍ [[ឯកសារ:example.png|200px|alt=Example alt text]]. រូប​ភាព​គឺ​ត្រូវ​បាន​កំណត់​ឲ្យ​ដាក់​នៅ​កណ្ដាល​តាម​លំនាំ​ដើម។ មើល WP:ALT
caption, caption2
ជា​អក្សរ​ដាក់​នៅ​ផ្នែក​ខាង​ក្រោម​រូប​ភាព។
header(n)
ជា​អក្សរ​ប្រើ​ជា​បឋមកថា​នៅ​ក្នុង​ជួរទី n។
label(n)
ជា​អក្សរ​ប្រើ​ជា​ស្លាក​នៅ​ក្នុង​ជួរទី n។
data(n)
ជា​អក្សរ​ប្រើ​សម្រាប់​បង្ហាញ​ជា​ទិន្នន័យ​នៅ​ក្នុង​ជួរទី n។
below
ជា​អក្សរដាក់​នៅ​បាត។ ប្រឡោះ​នៅ​បាត​ត្រូវ​បាន​បម្រុស​សម្រាប់ កំណត់​ត្រា​បាតក្រោម (footnotes), មើល​ផង​ដែរ, និង ព័ត៌មាន​ផ្សេងៗ។
child
មើល​ជំពូក embedding សម្រាប់​ព័ត៌មាន​លម្អិត។

កំណត់​ចំណាំ៖ នៅ​ពេល​ឥឡូវ, បឋមកថា, ស្លាក និង ទិន្នន័យ នៅ​ជាមួយ​តម្លៃ n ដូច​គ្នា វា​មិន​មែន​មិន​ចុះ​សម្រុង​គ្នា​ទៀត​ទេ គឺ​វា​នឹង​ត្រូវ​បង្ហាញ។ មើល​ការ​ផ្ដល់​លទ្ធផល​នៃ header4, label4, និង data4 នៅ​ក្នុង​ជំពូក​ឧទាហរណ៍​ខាង​ក្រោម។

រចនាបថ CSS ដែល​អាច​ប្រើ​តាម​ចិត្ត[កែប្រែ]

bodystyle
អនុវត្ត​ទៅ​លើ​តារាង​ប្រអប់​ព័ត៌មាន​ទាំង​មូល
titlestyle
អនុវត្តតែលើអធិប្បាយប្រធានប៉ុណ្ណោះ។ ការបញ្ចូលពណ៌ផ្ទាំងក្រោយជាធម្មតាគឺមិនមានមែនជាភាពឈ្លាសឡើយ ដោយពាក្យពេចន៍គឺត្រូវបានប្រតិបត្តិនៅ "ខាងក្រៅ" នៃប្រអប់ព័ត៌មាន
abovestyle
អនុវត្តតែលើបន្ទប់ "លើ" នៅផ្នែកខាងលើ។ រចនាបថតាមលំនាំដើមមានពុម្ពអក្សរធំ font-size:large ដោយបន្ទប់នេះជាធម្មតាត្រូវបានប្រើសម្រាប់ប្រធាន ប្រសិនជាអ្នកចង់ប្រើពុម្ពអក្សរស្មើវិញ ដាក់ "font-size:medium;" ក្នុង abovestyle
imagestyle
អនុវត្តទៅលើបន្ទប់ដែលមានរូប។ នេះរួមទាំងពាក្យពេចន៍នៃអធិប្បាយរូប ប៉ុន្តែអ្នកគួរកំណត់លក្ខណៈសម្បត្តិនៃពាក្យពេចន៍ជាមួយ captionstyle ជាជាង imagestyle ក្នុងករណីអធិប្បាយត្រូវបានរើចេញនៅពេលខាងមុខ
captionstyle
អនុវត្តទៅលើពាក្យពេចន៍នៃអធិប្បាយរូប
headerstyle
អនុវត្តទៅលើពួកបន្ទប់នៃបឋមកថាទាំងអស់
labelstyle
អនុវត្តទៅលើពួកបន្ទប់នៃស្លាកទាំងអស់
datastyle
អនុវត្តទៅលើពួកបន្ទប់នៃទិន្នន័យទាំងអស់
belowstyle
អនុវត្តតែលើបាតបន្ទប់

ថ្នាក់នៃ HTML[កែប្រែ]

bodyclass
ថាវរូបនេះត្រូវបានបញ្ចូលទៅក្នុងគុណលក្ខណ៍ "ថ្នាក់" សម្រាប់ប្រអប់ព័ត៌មានទាំងមូល។
titleclass
ថាវរូបនេះត្រូវបានបញ្ចូលទៅក្នុងគុណលក្ខណ៍ "ថ្នាក់" សម្រាប់អធិប្បាយនៃប្រធានរបស់ទំព័រគំរូ។
aboveclass
ថាវរូបនេះត្រូវបានបញ្ចូលទៅក្នុងគុណលក្ខណ៍ "ថ្នាក់" សម្រាប់បន្ទប់ "លើ" របស់ទំព័រគំរូ។
aboverowclass
ថាវរូបនេះត្រូវបានបញ្ចូលទៅក្នុងគុណលក្ខណ៍ "ថ្នាក់" សម្រាប់ជួរនៃតារាងពេញលេញដែលបន្ទប់ "លើ" ស្ថិតនៅ។
subheaderclass
ថាវរូបនេះត្រូវបានបញ្ចូលទៅក្នុងគុណលក្ខណ៍ "ថ្នាក់" សម្រាប់បឋមកថារងរបស់ទំព័រគំរូ។
subheaderrowclass
ថាវរូបនេះត្រូវបានបញ្ចូលទៅក្នុងគុណលក្ខណ៍ "ថ្នាក់" សម្រាប់ជួរនៃតារាងពេញលេញដែលបឋមកថារងស្ថិតនៅ។
imageclass
ថាវរូបនេះត្រូវបានបញ្ចូលទៅក្នុងគុណលក្ខណ៍ "ថ្នាក់" សម្រាប់រូប ហើយវាជាពិសេសត្រូវបានប្រើនៅឈ្នាប់ជាមួយ {{Image class names}}។
imagerowclass1, imagerowclass2
ថាវរូបនេះត្រូវបានបញ្ចូលទៅក្នុងគុណលក្ខណ៍ "class" សម្រាប់ជួរនៃតារាងពេញលេញដែលរូបរៀងៗគ្នាស្ថិតនៅ។
rowclass(n)
ថាវរូបនេះត្រូវបានបញ្ចូលទៅក្នុងគុណលក្ខណ៍ "ថ្នាក់" សម្រាប់ជួរជាក់លាក់ រួមទាំង ស្លាកឬពាក្យពេចន៍ពន្យល់ដទៃ។
class(n)
ថាវរូបនេះត្រូវបានបញ្ចូលទៅក្នុងគុណលក្ខណ៍ "ថ្នាក់" សម្រាប់បន្ទប់ទិន្នន័យនៃជួរជាក់លាក់។ ប្រសិនបើគ្មានបន្ទប់ទិន្នន័យនោះវាក៏គ្មានផលឡើយ។
belowclass
ថាវរូបនេះត្រូវបានបញ្ចូលទៅក្នុងគុណលក្ខណ៍ "ថ្នាក់" សម្រាប់បន្ទប់បាតរបស់ទំព័រគំរូ។

មីក្រូហ្វរម៉ាត[កែប្រែ]

ទំព័រគំរូនេះគាំទ្រការបន្ថែមនៃព័ត៌មានមីក្រូហ្វរម៉ាត។ វាត្រូវបានធ្វើឡើងដោយគុណលក្ខណ៍ "ថ្នាក់" បន្ទប់ទិន្នន័យផ្សេងៗ ចង្អុលប្រាប់នួវបែនៃព័ត៌មានដែលចុះទៅក្នុង។ ដើម្បីកំណត់ចង្អុលប្រអប់ព័ត៌មានមួយដោយរួមមានព័ត៌មាន hCard ជាឧទាហរណ៍ បន្ថែមថាវរូបតទៅនេះ:

|bodyclass = vcard

ហើយសម្រាប់ជួរនីមួយៗដោយរួមមានបន្ទប់ទិន្នន័យមួយដែលជាផ្នែកនៃ vcard បន្ថែមថាវរូបថ្នាក់ជាបន្ត:

|class1 = fn
|class2 = org
|class3 = tel

...ហើយជាដើម៘ "លើ" និង "ប្រធាន" ផងដែរអាចបានអោយនូវថ្នាក់ ដោយពួកវានេះ ជាធម្មតាត្រូវបានប្រើដើម្បីបង្ហាញឈ្មោះនៃប្រធានវត្ថុនៃទំព័រគំរូ។

មើលវីគីភីឌា:វីគីគម្រោង មីក្រូហ្វរម៉ាត សម្រាប់ព័ត៌មានបន្ថែមអំពីការបន្ថែមព័ត៌មានទ្រង់ទ្រាយតូចៗទៅក្នុងវីគីភីឌា និង មីក្រូហ្វរម៉ាត សម្រាប់ព័ត៌មានបន្ថែមពីពួកមីក្រូហ្វរម៉ាតជាទូទៅ។

ប្រធានទ្រេត[កែប្រែ]

ពួកប្រធាននៃអត្ថបទអាចធ្វើអោយទ្រេតបាន ក្នុងបន្ទាត់ជាមួយ WP:ITALICTITLE ដោយបោះចូលនូវចូល italic title

  • បើកប្រធានទ្រេតដោយបោះចូលនូវ |italic title={{{italic title|}}} ពីប្រអប់ព័ត៌មាន។
  • បិទតាមលំនាំដើមតែអោយករណីខ្លះទ្រេតដោយបោះចូលនូវ |italic title={{{italic title|no}}}
  • កុំបង្កើតប្រធានទ្រេតណាដោយមិនបោះចូលនូវថាវរូបអ្វីសោះឡើយ។

Making fields optional[កែប្រែ]

A row with a label but no data is not displayed. This allows for the easy creation of optional infobox content rows. To make a row optional use a parameter that defaults to an empty string, like so:

|label5 = Population
|data5  = {{{population|}}}

This way if an article doesn't define the population parameter in its infobox the row won't be displayed.

For more complex fields with pre-formated contents that would still be present even if the parameter wasn't set, you can wrap it all in an "#if" statement to make the whole thing vanish when the parameter is not used. For instance, the "#if" statement in the following example reads "#if:the parameter mass has been supplied |then display it, followed by 'kg'":

|label6 = Mass
|data6  = {{#if:{{{mass|}}}|{{{mass}}} kg}}

For more on #if, see here.

You can also make headers optional in a similar way. If you want a header to appear only if one or more of the data fields that fall under it are filled, one could use the following pattern as an example of how to do it:

{{Infobox
|name    = {{subst:PAGENAME}}
|title   = Example of an optional header
|header1 = {{#if:{{{item_one|}}}{{{item_two|}}}{{{item_three|}}}|Optional header}}
|label2  = Item one
|data2   = {{{item_one|}}}
|label3  = Item two
|data3   = {{{item_two|}}}
|label4  = Item three
|data4   = {{{item_three|}}}
}}

header1 will be shown if any of item_one, item_two, or item_three is defined. If none of the three parameters are defined the header won't be shown.

The trick to this is that the "if" returns false only if there is nothing whatsoever in the conditional section, so only if all three of item_one, item_two and item_three are undefined will the if statement fail.

Examples[កែប្រែ]

Test Infobox
Example alt text
Caption for example.png
Header defined alone
Data defined alone
All three defined (header, label, data, all with same number)
Label and data defined (label)Label and data defined (data)
Below text
{{Infobox
|name         = Infobox/doc
|bodystyle    = 
|title        = Test Infobox
|titlestyle   = 

|image        = [[File:example.png|200px|alt=Example alt text]]
|imagestyle   = 
|caption      = Caption for example.png
|captionstyle = 
|headerstyle  = background:#ccf;
|labelstyle   = background:#ddf;
|datastyle    = 

|header1 = Header defined alone
|label1  = 
|data1   = 
|header2 = 
|label2  = Label defined alone does not display (needs data, or is suppressed)
|data2   = 
|header3 =
|label3  = 
|data3   = Data defined alone
|header4 = All three defined (header, label, data, all with same number)
|label4  = does not display (same number as a header)
|data4   = does not display (same number as a header)
|header5 =
|label5  = Label and data defined (label)
|data5   = Label and data defined (data)

|belowstyle = background:#ddf;
|below = Below text
}}

Notice how when a label is defined without an accompanying data cell the row doesn't appear in the displayed infobox, and when a header is defined on the same row as a data cell all of them are displayed.

For this example, bodystyle = width:20em; and labelstyle = width:33%;

Test Infobox
Label 1Data 1
Label 2Data 2
Label 3Data 3
Header 4
Label 5Data 5: Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
Below text
{{Infobox
|bodystyle   = width:20em;
|name        = Infobox/doc
|title       = Test Infobox
|titlestyle  = 
|headerstyle = 
|labelstyle  = width:33%
|datastyle   = 

|header1 = 
|label1  = Label 1
|data1   = Data 1
|header2 = 
|label2  = Label 2
|data2   = Data 2
|header3 = 
|label3  = Label 3
|data3   = Data 3
|header4 = Header 4
|label4  = 
|data4   = 
|header5 = 
|label5  = Label 5
|data5   = Data 5: Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.

|belowstyle = 
|below = Below text
}}

Embedding[កែប្រែ]

One infobox template can be embedded into another using the |child= parameter. This feature can be used to create a modular infobox, or to create more well defined logical sections.

Top level title
First subsection
Label 1.1Data 1.1
Second subsection
Label 2.1Data 2.1
Below text
{{Infobox
| title = Top level title
| data1 = {{Infobox
  | child = yes
  | title = First subsection
  | label1= Label 1.1
  | data1 = Data 1.1
}}
| data2 = {{Infobox
  | child = yes
  | title = Second subsection
  | label1= Label 2.1
  | data1 = Data 2.1
}}
|belowstyle = 
|below = Below text
}}

Full blank syntax[កែប្រែ]

(Note: the template currently handles up to 80 rows; only 20 are included here since infoboxes larger than that will be relatively rare. Just extend the numbering as needed. The microformat "class" parameters are also omitted as they are not commonly used.)

{{Infobox
|name         = {{subst:PAGENAME}}
|bodystyle    = 
|title        = 
|titlestyle   = 
|above        = 
|abovestyle   = 

|imagestyle   = 
|captionstyle = 

|image        = 
|caption      = 
|image2       = 
|caption2     = 

|headerstyle  = 
|labelstyle   = 
|datastyle    = 

|header1  = 
|label1   = 
|data1    = 
|header2  = 
|label2   = 
|data2    = 
|header3  = 
|label3   = 
|data3    = 
|header4  = 
|label4   = 
|data4    = 
|header5  = 
|label5   = 
|data5    = 
|header6  = 
|label6   = 
|data6    = 
|header7  = 
|label7   = 
|data7    = 
|header8  = 
|label8   = 
|data8    = 
|header9  = 
|label9   = 
|data9    = 
|header10 = 
|label10  = 
|data10   = 
|header11 = 
|label11  = 
|data11   = 
|header12 = 
|label12  = 
|data12   = 
|header13 = 
|label13  = 
|data13   = 
|header14 = 
|label14  = 
|data14   = 
|header15 = 
|label15  = 
|data15   = 
|header16 = 
|label16  = 
|data16   = 
|header17 = 
|label17  = 
|data17   = 
|header18 = 
|label18  = 
|data18   = 
|header19 = 
|label19  = 
|data19   = 
|header20 = 
|label20  = 
|data20   = 

|belowstyle =
|below = 
}}

Porting to other MediaWikis[កែប្រែ]

The infobox template requires the tidy extension to be installed, and may not work with other MediaWikis the WP:TRAN has a version of Infobox that has been modified to work on other MediaWikis.

See also[កែប្រែ]