সাহায্য:Page breaks
← Help:Contents | Page breaks |
namespace. | This page explains solutions to common problems relating to text being broken across pages in the Page:
Page breaks can cause several problems when transcluding texts, even if the individual pages render well in the Page: namespace.
Templates across page breaks
সম্পাদনাIf you have a template that spans a page break, you cannot just put the opening of the template (eg {{fine block| on the first page and the closing }} on the next page. This is because the Wikimedia software first renders the wikicode on each page, before transclusion, so the software never notices that a template is closed in a later page: it treats it as normal text.
To get around this you need to use a "split" form of this template, along with the header and footer fields in the Page: namespace edit view (if you don't have these visible, click the [+] button in the toolbar). This means that only a single "start" and "end" template appear in the transclusion, but the contained text is not actually inside a template. Each page is also wrapped in the Page: namespace, using the header and footer fields, so it appears correctly both before and after transclusion.
Method
সম্পাদনাFirst page
সম্পাদনা- Body
{{fine block/s}} First page text
- Footer
{{fine block/e}}
Middle pages
সম্পাদনা- Header
{{fine block/s}}
- Body
Middle page text
- Footer
{{fine block/e}}
Last page
সম্পাদনা- Header
{{fine block/s}}
- Body
Last page text {{fine block/e}}
Templates that use this system
সম্পাদনাThis method is used by many templates. These are "block" level templates like {{fine block}}, as "span" level templates like {{smaller}} don't cause a line break when they are ended. If you need to run a span template across page, simply terminate the first template on the first page, and start a new one on the second.
- {{block center}}: {{block center/s}}, {{block center/e}} (this is actually a table, see below)
- {{fine block}}: {{fine block/s}}, {{fine block/e}}
- {{smaller block}}: {{smaller block/s}}, {{smaller block/e}}
- {{div col}}, {{div col end}} (no unsplit template)
If the block template you would like to use across a page break doesn't have a split variant, create it using one of the templates above as a reference. Remember to transclude the documentation from the unsplit template page.
Tables across page breaks
সম্পাদনাTables split over pages are done the same way as the split templates above, using the table syntax of {| and |} instead of {{template/s}} and {{template/e}}. For some commonly used table formatting, split templates such as {{block center/s}} and {{TOC begin}} already exist, and are used as described above.
For a one-off split-table, you don't need to make a template.
Method
সম্পাদনাFirst page
সম্পাদনা- Body
{| class="class?" style="table styling here" |- |Table contents |-
- Footer
|}
Middle pages
সম্পাদনা- Header
{| class="class?" style="table styling here" (same as first page, or this page will render wrongly in the page view) |-
- Body
{{nop}} |More table rows |-
- Footer
|}
Last page
সম্পাদনা- Header
{| class="class?" style="table styling here" (same as first page, or this page will render wrongly in the page view) |-
- Body
{{nop}} |More table rows |}
Footer content beneath a table which crosses pages
সম্পাদনাDistinct from but related to the above is the case where footer content ought to appear (typically a footnote or page number) beneath a "first" or "middle" component of a multi-page-crossing table. The following code looks like it ought to work but in fact fails:
First page | Middle page |
---|---|
{| class="class?" style="table styling here" |- |Table contents |-
|} <references/> |
{| class="class?" style="table styling here" (same as first page, or this page will render wrongly in the page view) |-
{{nop}} |More table rows |-
|} <references/> |
Under the current software the footnotes are frustratingly rendered above the top of the table instead of where you might expect them to appear.
Method
সম্পাদনাThe solution is to insert a {{nop}} into the footer just above the |}
like this:
First page | Middle page |
---|---|
{| class="class?" style="table styling here" |- |Table contents |-
{{nop}} |} <references/> |
{| class="class?" style="table styling here" (same as first page, or this page will render wrongly in the page view) |-
{{nop}} |More table rows |-
{{nop}} |} <references/> |
Footnotes across page breaks
সম্পাদনাFootnotes that span more than one page are handled in a similar way to normal. The method below will display correctly both in the Page namespace and when transcluded into the Main namespace.
Method
সম্পাদনাFirst page
সম্পাদনা- Body
Lorem ipsum dolor sit amet,<ref name="p76">dolorem ipsum, quia dolor sit amet,</ref>
- Footer
{{smallrefs}}
Subsequent pages
সম্পাদনা- Body
…est laborum.<ref follow="p76">consectetur, adipisci velit…</ref>
- Footer
{{smallrefs}}
Potential problems
সম্পাদনা- The
<ref name=…>
can be anything, but the use of the page number is preferred.
- Normally the
<ref follow=…>
is at the end of the page. However, if there is a change of section – for transcluding in a different chapter – then continued footnote should be moved to the top of the page, or else it will not be transcluded.
- Long footnotes may have multiple paragraphs; the use of double carriage returns to start a new paragraph will not work in the transcluded footnotes – it has to be forced by wrapping the second and subsequent paragraphs with the HTML paragraph tags
<p>…</p>
.
Newlines across pagebreaks
সম্পাদনাThe default behavior for transclusion is to just add a space between the text of two pages, even when there should be a paragraph break, or when there should be no space at all. There are a few templates to assist in such cases.
Template | You type | You get |
{{Hyphenated word start}} or {{hws}} | This page ends with the split word "{{Hyphenated word start|abso|absolutely}} | This page ends with the split word "abso- |
{{Hyphenated word end}} or {{hwe}} | {{Hyphenated word end|lutely|absolutely}}," split between two pages. | -lutely," split between two pages. |
{{nop}} | Used where the end of a page is also end of a paragraph. |
NB: The hyphenated word start and hyphenated word end should be paired across two pages in the Page namespace. They will appear correctly as one, unhyphenated word when transcluded to the main namespace.
|