Pergi ke kandungan

Templat:Transclude lead excerpt/doc

Daripada Wikipedia, ensiklopedia bebas.

Transclude lead petikan transclude lead artikel sebagai petikan. Ia direka bentuk untuk digunakan dalam portals, stand-alone list dan outlines. Ia mengembalikan teks artikel yang dinamakan sehingga tetapi tidak termasuk pengepala pertama, selepas mengalih keluar:

  • templat awal seperti kotak maklumat, nota topi dan tag penambahbaikan artikel
  • noinclude bahagian
  • rujukan dan nota kaki
  • imej, melainkan disimpan secara khusus

Ia juga digunakan untuk berkongsi bahagian petunjuk antara halaman glosari berbilang halaman.

Penggunaan

[sunting sumber]
{{Transclude lead excerpt | 1= | paragraphs= | files= | fileargs= | errors= }}

Parameters

[sunting sumber]

Templat memerlukan satu parameter: nama halaman untuk ditransklusikan. Sertakan ruang nama jika perlu. Tiada parameter kedudukan lain, tetapi terdapat beberapa parameter bernama pilihan:

  • Senarai perenggan seperti perenggan=1,3-5; lalai ialah semua perenggan.
  • Senarai nombor fail (imej) seperti files=1; lalainya ialah tiada imej. Imej bukan percuma dialih keluar.
  • Argumen untuk dihantar ke Fail: seperti fileargs=left untuk mengalihkan imej ke kiri; lalai adalah tiada.
  • errors= untuk membenarkan mesej ralat Lua muncul dalam output

perenggan= dan fail= setiap satu menerima senarai dipisahkan koma yang mengandungi nombor dan/atau julat nombor dalam format min-maks. Sebagai alternatif, files= boleh menerima nama satu imej, mis. files=Fail imej saya.jpg.


Pelbagai pilihan

[sunting sumber]
  • |more=no – untuk menyekat pautan ke artikel di penghujung petikan. |more=teks tersuai untuk menyesuaikan teks pautan pada penghujung petikan. Lalai ialah "Artikel penuh...".
  • keepSubsections=1 akan menyebabkan Article#Section mengekalkan mana-mana subseksyen bahagian itu
  • keepRefs=1 akan menyimpan rujukan untuk paparan dalam {{reflist}} atau yang serupa
  • nobold=1 akan menyebabkan teks tebal dipaparkan dalam fon biasa

Pilihan halaman

[sunting sumber]

Setiap halaman yang akan ditransklusikan boleh ditentukan sama ada biasa atau sebagai pautan wiki, mungkin disalurkan. Pautan ke bahagian juga berfungsi dan mengekstrak bahagian yang dinamakan dan bukannya petunjuk. Contoh: Artikel; Artikel#Section; [[Artikel]]; [[Article#Section|Bahagian artikel]]. (Sebarang teks yang disalurkan akan diabaikan.)

Any of the above formats may be followed by option(s) separated by pipes, e.g. Article|paragraphs=2. Such options override any global options for the given page only. Note that the characters | and = have special meaning within calls to templates but can be escaped using {{!}} and {{=}} respectively. Examples: Article#Section{{!}}files{{=}}2; [[Article|Some page]]{{!}}files{{=}}3,4{{!}}more{{=}}Click here. (= need not be escaped if the parameter is explicitly numbered, e.g. 1=Article{{!}}files=2).

Special characters such as pipes within page options must be doubly escaped, replacing their double braces by {{((}} and {{))}}. For example, to set display Custom image.jpg on the left with a custom caption, set fileargs to left|Custom caption using Article{{!}}files{{=}}Custom image.jpg{{!}}fileargs{{=}}left{{((}}!{{))}}Custom caption. To add a wikilink within a caption, escape the link brackets and any pipe twice using {{!((}}, {{))!}} and possibly {{!}}, e.g. Caption with {{((}}!(({{))}}Pipe (computer science){{((}}!{{))}}piped{{((}}))!{{))}} link. This text can be achieved more simply using {{Doubly escaped wikilink}}, e.g. Caption with {{Doubly escaped wikilink|Pipe (computer science)|piped}} link.

See also

[sunting sumber]

Similar templates also using Module:Excerpt:

The templates were discussed at Use of direct transclusion in portals and the newer portal transclusion templates.

  • {{Excerpt}}: template designed for excerpt transclusion in articles

Templat:Portal templates navbox

TemplateData

[sunting sumber]

Transclude lead excerpt transcludes the lead of an article as an excerpt

Parameter templat

Templat ini lebih menyukai pemformatan parameter dalam baris.

ParameterKeteranganJenisStatus
11

The name of the page to be transcluded

Tersedia
empty
Contoh
Aviation, 1=Aviation
Rentetandiperlukan
Paragraphsparagraphs

Numbers of the paragraphs to be transcluded, as a comma-separated list containing numbers and/or number ranges in the format min-max

Tersedia
all paragraphs
Contoh
paragraphs=1,3-5
Rentetanpilihan
Filesfiles

Numbers of the images to be transcluded, as a comma-separated list containing numbers and/or number ranges in the format min-max

Tersedia
no files
Contoh
files=1,3-5
Rentetanpilihan
FileArgsfileargs

Arguments to pass to File:

Tersedia
no arguments
Contoh
fileargs=left
Rentetanpilihan
Moremore

Text for trailing link to the entire article. Note: more= with no value produces the standard text: Read more...

Tersedia
no link
Contoh
more=(more)
Rentetanpilihan
Errorserrors

Allow Lua error messages to appear in the output?

Tersedia
false
Contoh
errors=true
Booleanpilihan