DPL talk:Manual - DPL parameters: Controlling output volume

From FollowTheScore
Revision as of 16:08, 23 June 2008 by Nanda (talk | contribs) (Exclude images and other wikicode)
Jump to: navigation, search

Special Tags

Hi, the manual says: "a text portion which is marked by special tags named "foo"", but there is not explanation how to put a marker tag foo in all the articles which appear in DPL listing. Janek Kozicki


10 lines above the manual refers to LabeledSectionTransclusion. Read that. Gero 08:32, 10 October 2007 (CEST)

Include and Template Parameters

What if a page includes a particular template or page more than once. Is there a way to specify the parameters of the nth call to said template? —Sledged (talk) 06:13, 10 October 2007 (CEST)


This sounds rather exotic. You can apply a regexp to the call parameters for filtering - and I guess that the n-th template invocation can be recognized by some difference in the parameters from the (n-1)th invocation ... Isn´t that enough?

Gero 08:32, 10 October 2007 (CEST)
I'm not sure I understand how that'd work. Can you give an example? —Sledged (talk) 00:28, 24 October 2007 (CEST)
If you call a template 10 or twenty times from an article: Why would you want to extract exactly the 10th invocation? I would assume that you are more interested in certain parameter constellations instead of the position of the template call ... Unless you give a convincing example I can´t see why we should count template invocations ..
To pick a template call based on the argument values it uses the includematch statement can be used. Gero 23:57, 25 October 2007 (CEST)
I wasn't actually saying that it should count template invocations. I was merely asking (in not so many words) "Does it count template invocations?" Going by your response, I'm guessing no.
In most situations I probably wouldn't want the nth invocation of a template, unless I wanted to randomly select one of invocations for sampling or such. However, I could see wanting to get the first n invocations or the last i invocations.
Also, without a means to select a specific template invocation, which one is selected if multiple ones exist? The first? The last? All? Randomized? Undefined? —Sledged (talk) 22:05, 8 November 2007 (CET)
I have been looking for that functionality. We have pages with the same template used more that once. For example, to add a section of text in a particular format, we have
{{Project detail
type=description
content=...
}}
{{Project detail
type=purpose
content=...
}}
I would like to include only calls to the {{Project detail}} template where the type=description. --Stc user 18:06, 13 May 2008 (CEST)
I tried includematch and includematchparsed with no luck. Should I add this as a new feature request? --Stc user 18:20, 13 May 2008 (CEST)
to Stc user: You are talking about a standard fuctionality of DPL, which is already available. There are examples i this wiki that show how to do it; read the manual... --Gero

include Parameter and Labeled Section Transclusion

Aside from it being integrated with DPL2, how much functionality has been added to DPL2's version of Labeled Section Transclusion? Is it possible to achieve everything that the include parameter does by nesting a {{#lst:}} call in the {{#dpl:}} call?

|format=,,\n¦²{#lst:%PAGE%¦%0[100]}²\n¦align=right¦%COUNT%\n,

Also, does either version of Labeled Section Transclusion interact with the <includeonly> and <noinclude> tags? —Sledged (talk) 20:17, 27 November 2007 (CET)

Never mind, found the answer for myself: "No." —Sledged (talk) 20:30, 27 November 2007 (CET)

Version of Labeled Section Transclusion

From what version of Labeled Section Transclusion did DPL2's version branch? —Sledged (talk) 20:53, 27 November 2007 (CET)

This was roughly one year ago. And as far as I am aware of, Labeled Section Transclusion (LST) wasn´t changed very much after that time. But the version within DPL underwent quite some changes. While still being downward compatible (I hope) it can handle a lot more than just pull in text that is enclosed between special markers. The last feature which was (half-heartedly I would say) adopted by LST was the ability to transclude sections (paragraphs) based on their heading. Steve Sanbeg felt that headlines might not be stable enough to serve as a reference point for contents transclusion ... --Gero 21:26, 27 November 2007 (CET)

include: Retrieving the nth Section

I'm looking at the method DPL2Include::extractHeadingFromText and there's a comment that says "check if we are going to fetch the n-th section." Is this the functionality of section ranges, or is it something else. If it's something else, I don't see any documentation of this functionality. —Sledged (talk) 22:18, 30 November 2007 (CET)

Nevermind. "Section" in the comments context refers to what's called "chapter" in the manual. TODO: Make terms in comments and manual uniform. —Sledged (talk) 22:24, 30 November 2007 (CET)
sadly, yes. Terminolgy is not consistent. I´m afraid sometimes you can also find 'paragraph', too. Gero 00:30, 1 December 2007 (CET)

$to Argument in DPL2Include::extractHeadingFromText

Did you have a specific syntax in mind for invoking this parameter? In the code, every call to this method sets the $to parameter to an empty string. —Sledged (talk) 18:48, 24 December 2007 (CET)

No, I took it from the original source of LabeledSectionTransclusion and didn`t need it but could not make up my mind to delete it. Gero 23:37, 25 December 2007 (CET)

Exclude images and other wikicode

Is there way to exclude Images and other wikicode wenn using the tag: include=*

No, you get the full wiki code. If you were able to write a single regular expression which "cleans" the code in the way you want, I might be able to add an option which runs an arbitrary regexp against the result of include=* before returning and expanding it. I suggest that you try patching the code with a hardcoded regex and then let us know ... Gero 22:02, 20 June 2008 (CEST)

Ofcourse deleting the images with preg_replace depends on the language. Maybe you can use variables like this in the LocalSettings?

$patterns[0] = '/\[\[Afbeelding:.*\]\]/';

$patterns[1] = '/\[\[Image:.*\]\]/';

$patterns[2] = '/<.*/.*>/'; //Delete all wikicode from extensions like youtube and maps

etc.