|
|
(10 intermediate revisions by 2 users not shown) |
Line 1: |
Line 1: |
− | {{Issue | + | <includeonly>{{Issue |
− | |Extension = DPL | + | |Type = Bug | Change Request <-- please select |
− | |Version = 1.4.2 | + | |Extension = DPL | Wgraph | aiSee | Call <-- please select |
− | |Description = Trying to include sections that have a link in their headline | + | |Version = ? |
− | |Status = resolved | + | |Description = |
| + | |Status = open |
| }} | | }} |
| | | |
− | I'm trying to include particular sections with 'include' and the section headers are links. So I use
| + | == Problem == |
− | <nowiki>{{#dpl:titlematch=%Bug Reports%Include%|include=#[[Link]]}}</nowiki> and I get
| + | Your text goes here .. |
− | an error.
| |
| | | |
− | == Reply ==
| |
− | The problem is that the parser converts the double brackets into a hyperlink before the text is used as a search criterion within DPL. I will look if there is a way around this. [[User:Gero|Gero]] 23:26, 27 September 2007 (CEST)
| |
| | | |
− | == Reply(2) ==
| |
− | Please download the latest version (1.4.3) and use the following trick:
| |
− | <nowiki>{{#dpl:titlematch=%Bug Reports%Include%|include=##.\[Link\].}}</nowiki>
| |
− | This will produce the expected result. The double '##' means that the text shall be used as a regular expression. Within the regexp you must escape the '['. But you must NOT try something like <tt>\[\[Link\]\]</tt> although this looks quite reasonable. DPL would misunderstand that as range specification (the include statement accepts a character range to delimit the output size). By makingthe last character a dot (".") we circumvent that and the regexp still matches.
| |
− | {{#dpl:titlematch=%Bug Reports%Include%|include=##.\[Link\].}}
| |
| | | |
− | ==Reply to reply== | + | == Reply == |
− | I can still make the script give me an error: "Warning: preg_match() [function.preg-match]: Unknown modifier '0' in .../semeb/DynamicPageList/DynamicPageList2Include.php on line 285". I'm actually trying to get something more complicated to work. On a page, I have a variety of template calls to a certain template like <nowiki>{{foo|arg1|blah}} {{foo|arg2|whatever}} ...</nowiki>. Template foo looks like:
| + | </includeonly> |
− | | |
− | <pre>
| |
− | ==[[{{{1}}}]]==
| |
− | {{{2}}}
| |
− | </pre>
| |
− | | |
− | Now I want to summarize all the sections that call template foo with arg1 (and not with arg2). So I can select pages based on those that use template foo and link to arg1, i.e. <nowiki>{{#dpl:uses=Template:Foo|linksto=arg1}}</nowiki>, but now I also want to include the text that's within that section so I try to include that section as described above and it doesn't work. In fact, it doesn't seem like DPL sees the heading at all when it's generated from the template. If there's a better way to do this, let me know.
| |
− | | |
− | ==Reply to reply (2)==
| |
− | I you use a regex you will always be able to provoke syntax errors. If your regex contains a mistake that´s no surprise. Btw: I would consider this an expert feature.
| |
− |
| |
− | Mediawiki has general problems with dynamically generated chapters. If you try section-editing on a document that uses templates to generate sections you will be surprised what happens.
| |
− |
| |
− | DPL uses the plain source of an article when it analyses its text. That is why you never will "see" chapter headlines generated by templates. I ran into the same problem and decided to have the heading within the main article and use templates (only) to produce the chapter´s contents. That works fine.
| |
− | Summarizing sections then means to use DPL <tt>include</tt> and <tt>includematch</tt>. You should use <tt>includematch</tt> to select the template invocations with "arg1", that is much more efficient and the includematch statement is exactly meant to be used for that purpose.
| |
− | | |
− | [[User:Gero|Gero]] 12:16, 29 September 2007 (CEST)
| |