Dplchapter: Difference between revisions
m Alianin moved page DPL:Dplchapter to Extension:DPL3/Dplchapter without leaving a redirect: Changing namespaces. |
imported>FrozenPlum m Minor fix |
||
(14 intermediate revisions by 4 users not shown) | |||
Line 1: | Line 1: | ||
{{DPL |
{{DPL manual|section=dplchapter}} |
||
⚫ | |||
⚫ | |||
<pre><nowiki> |
<pre><nowiki> |
||
{{#dplchapter: text | heading | limit | page | linktext }} |
{{#dplchapter: text | heading | limit | page | linktext }} |
||
</nowiki></pre> |
</nowiki></pre> |
||
⚫ | |||
=== Effect === |
|||
⚫ | 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. |
||
⚫ | |||
⚫ | |||
⚫ | |||
{{#lsth:Examples/Module: dplchapter (example 1)|Example}} |
|||
{{ViewTest|Examples|Module: dplchapter (example 1)}} |
|||
'''Result 1:''' |
|||
⚫ | |||
{{#lsth:Examples/Module: dplchapter (example 1)|Result}} |
|||
<pre><nowiki> |
|||
{{#dplchapter: |
|||
Some text. |
|||
==== My Headline ==== |
|||
the body of the desired chapter. |
|||
==== Another Chapter ==== |
|||
Its text. |
|||
|My Headline}} |
|||
</nowiki></pre> |
|||
<!-- |
|||
{{#dplchapter: |
|||
Some text. |
|||
==== My Headline ==== |
|||
the body of the desired chapter. |
|||
==== Another Chapter ==== |
|||
Its text. |
|||
|My Headline}} |
|||
--> |
|||
⚫ | |||
<pre><nowiki> |
|||
{{#dplchapter: |
|||
Some text. |
|||
==== My Headline ==== |
|||
the body of the desired chapter. |
|||
==== Another Chapter ==== |
|||
Its text. |
|||
|My Headline|15|Some Page|read more ..}} |
|||
</nowiki></pre> |
|||
⚫ | |||
<!-- |
|||
'''Example 2:''' |
|||
{{#dplchapter: |
|||
{{#lsth:Examples/Module: dplchapter (example 2)|Example}} |
|||
Some text. |
|||
{{ViewTest|Examples|Module: dplchapter (example 1)}} |
|||
==== My Headline ==== |
|||
the body of the desired chapter. |
|||
==== Another Chapter ==== |
|||
Its text. |
|||
|My Headline|15|Some Page|.. read more}} |
|||
--> |
|||
'''Result 2:''' |
|||
{{#lsth:Examples/Module: dplchapter (example 2)|Result}} |
|||
[[Category: |
[[Category:Other Modules]] |
Latest revision as of 03:31, 21 April 2023
|
Manual | dplchapter |
Syntax
{{#dplchapter: text | heading | limit | page | linktext }}
This function is a side entry into DPL's {{#vardefine:page_}}{{#vardefine:page| Controlling output volume}}[[{{#var:page}}|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: {{#lsth:Examples/Module: dplchapter (example 1)|Example}}
Page Template:ViewTest/style.css must have content model "Sanitized CSS" for TemplateStyles (current model is "plain text").
Result 1: {{#lsth:Examples/Module: dplchapter (example 1)|Result}}
Example 2
Example 2: {{#lsth:Examples/Module: dplchapter (example 2)|Example}}
Page Template:ViewTest/style.css must have content model "Sanitized CSS" for TemplateStyles (current model is "plain text").
Result 2: {{#lsth:Examples/Module: dplchapter (example 2)|Result}}