Dplchapter: Difference between revisions
imported>FrozenPlum Remove notice template as it is working now |
imported>FrozenPlum Embed now moved/testable examples |
||
Line 6: | Line 6: | ||
</nowiki></pre> |
</nowiki></pre> |
||
==Effect== |
|||
This function is a side entry into DPL's {{DPL3|include}} function. |
This function is a side entry into DPL's {{DPL3|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}} |
|||
<pre><nowiki> |
|||
{{ViewTest|Examples|Module: dplchapter (example 1)}} |
|||
{{#dplchapter: |
|||
Some text. |
|||
==== My Headline ==== |
|||
the body of the desired chapter. |
|||
==== Another Chapter ==== |
|||
Its text. |
|||
|My Headline}} |
|||
</nowiki></pre> |
|||
'''Result:''' |
'''Result 1:''' |
||
{{#lsth:Examples/Module: dplchapter (example 1)|Result}} |
|||
{{#dplchapter: |
|||
Some text. |
|||
==== My Headline ==== |
|||
the body of the desired chapter. |
|||
==== Another Chapter ==== |
|||
Its text. |
|||
|My Headline}} |
|||
===Example 2=== |
===Example 2=== |
||
'''Example 2:''' |
|||
<pre><nowiki> |
|||
{{#lsth:Examples/Module: dplchapter (example 2)|Example}} |
|||
{{#dplchapter: |
|||
{{ViewTest|Examples|Module: dplchapter (example 1)}} |
|||
Some text. |
|||
==== My Headline ==== |
|||
the body of the desired chapter. |
|||
==== Another Chapter ==== |
|||
Its text. |
|||
|My Headline|15|Some Page|read more ..}} |
|||
</nowiki></pre> |
|||
'''Result:''' |
'''Result 3:''' |
||
{{#lsth:Examples/Module: dplchapter (example 2)|Result}} |
|||
{{#dplchapter: |
|||
Some text. |
|||
==== My Headline ==== |
|||
the body of the desired chapter. |
|||
==== Another Chapter ==== |
|||
Its text. |
|||
|My Headline|15|Some Page|.. read more}} |
|||
[[Category:Other Modules]] |
[[Category:Other Modules]] |
Revision as of 02:55, 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 3: {{#lsth:Examples/Module: dplchapter (example 2)|Result}}