Dplchapter: Difference between revisions
uncommenting #dplchapter examples... they were commented out 7 years ago, but no longer cause a crash |
imported>FrozenPlum m Minor fix |
||
(9 intermediate revisions by the same user not shown) | |||
Line 6: | Line 6: | ||
</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. |
|||
'''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 1:''' |
|||
{{#dplchapter: |
|||
{{#lsth:Examples/Module: dplchapter (example 1)|Result}} |
|||
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> |
|||
⚫ | |||
{{#dplchapter: |
|||
'''Example 2:''' |
|||
Some text. |
|||
{{#lsth:Examples/Module: dplchapter (example 2)|Example}} |
|||
==== My Headline ==== |
|||
{{ViewTest|Examples|Module: dplchapter (example 1)}} |
|||
the body of the desired chapter. |
|||
==== Another Chapter ==== |
|||
Its text. |
|||
|My Headline|15|Some Page|.. read more}} |
|||
'''Result 2:''' |
|||
<!-- Extension prefix in other languages: |
|||
{{#lsth:Examples/Module: dplchapter (example 2)|Result}} |
|||
[[Category:Other Modules]] |
|||
[[de:Erweiterung:{{subst:BASEPAGENAME}}]] |
|||
[[es:Extensión:{{subst:BASEPAGENAME}}]] |
|||
[[fr:Extension:{{subst:BASEPAGENAME}}]] |
|||
[[it:Estensione:{{subst:BASEPAGENAME}}]] |
|||
[[nl:Uitbreiding:{{subst:BASEPAGENAME}}]] |
|||
[[pl:Rozszerzenie:{{subst:BASEPAGENAME}}]] |
|||
[[pt:Extensão:{{subst:BASEPAGENAME}}]] |
|||
[[ru:Расширение:{{subst:BASEPAGENAME}}]] |
|||
[[zh:扩展:{{subst:BASEPAGENAME}}]] |
|||
--> |
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}}