Dplchapter: Difference between revisions

From DynamicPageList3 Manual
Content added Content deleted
im>Maiden taiwan
(Commented out #dplchapter invocations because they crash with "Fatal error: Class 'DPLInclude' not found in /www/htdocs/w0057617/dpldemo/extensions/DynamicPageList/DPLSetup.php on line 1438")
 
imported>FrozenPlum
m (Minor fix)
 
(18 intermediate revisions by 5 users not shown)
Line 1: Line 1:
{{Type Manual|section=dplchapter}}
{{DPL manual|section=dplchapter}}

=== Syntax ===


==Syntax==
<pre><nowiki>
<pre><nowiki>
{{#dplchapter: text | heading | limit | page | linktext }}
{{#dplchapter: text | heading | limit | page | linktext }}
</nowiki></pre>
</nowiki></pre>


This function is a side entry into DPL's {{DPL3|include}} function.
=== 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.
This function is a side entry into DPL's [[include]] function.


'''Example 1:'''
You pass an arbitrary text to this function and you will get back the body of a chapter within this text which has 'heading' as a headline. You can delimit the output to a maximum number of characters. You will get a link to 'page' if the text is longer than that limit. The link will normally consist of some arrow but can be changed to whatever you want.
{{#lsth:Examples/Module: dplchapter (example 1)|Example}}
{{ViewTest|Examples|Module: dplchapter (example 1)}}


'''Result 1:'''
==== Example 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}}
-->

==== Example 2 ====

<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===
<!--
'''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:DPL Manual]]
[[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}}