Dplchapter
| ||||||||||||||
| Manual | dplchapter |
Syntax
[edit source] {{#dplchapter: text | heading | limit | page | linktext }}
This function is a side entry into DPL's include function.
An arbitrary text is passed to this function, and returned is the body of a chapter within this text, which has 'heading' as a headline. The output can be delimited to a maximum number of characters. A link to 'page' is produced if the text is longer than that limit. The link normally consists of some arrow, but can be changed to whatever is desired.
Example 1: This displays the body content of the heading/section that matches the heading name specified, in this case it returns the section content for the "My Headline" heading.
{{#dplchapter:
Some text.
==== My Headline ====
the body of the desired chapter.
==== Another Chapter ====
Its text.
|My Headline}}
Result 1: the body of the desired chapter.
Example 2
[edit source]Example 2: This displays the body content of the heading/section matching the heading name ("My Headline") specified, though it limits the output to a maximum length of 15 characters (while avoiding breaking words up). The statement also provides a page name to link to, then sets the link text to "read more..." for that page.
{{#dplchapter:
Some text.
==== My Headline ====
the body of the desired chapter.
==== Another Chapter ====
Its text.
|My Headline|15|Some Page|read more...}}
Result 2: the body of read more...