Talk:Manual

From FollowTheScore
Jump to: navigation, search

Template inclusion

From the manual:

  • To include variables which are used in a template call, specify the original template name within single curly braces and add a suffix; the template name including the suffix will be called instead of the original template and the result will contain just the output of your alternate template:
includepage = {template1}suffix1,{template1}suffix2,{template2}suffix3,....

Does this mean the following?

If page A is in the resulting set of pages, and A contains a call {{B|C}}, then includepage={B}D produces the result of {{BD|C}}.

That does not seem to work. What is meant? Can an example be given?--Patrick 17:09, 17 February 2007 (CET)

Your interpretation is exactly right. The template call to "B" is replaced by a call to "BD" with the same arguments, and you will get the result of the expansion of BD being called with the original parameters. Have a look at Example 2;
<DPL>
  category=African Union member states
  includepage={Infobox Country or territory} dpl
  mode=userformat
  addpagecounter=true
  listseparators=\n{|class=sortablewikitable id=123 \n!Country \n!Area \n!Population \n|#hits\n|-,\n|-\n|[[#%PAGE%|%PAGE%]]\n,\n|align=right|%COUNT%\n,\n|}
  secseparators=,\n|,,
</DPL>
The Template Template:Infobox Country or territory dpl is used to create the entries in the small table. Note that the space character between "territory" and "dpl" comes from the way the DPL statement was written and is significant. Maybe someting like "includepage={Infobox Country or territory}.dpl" would have been more instructive.
Can you please post the code snippet with which you tried? Maybe we can find the error and improve documentation based on the kind of error you made. -- Gero 20:17, 17 February 2007 (CET)
Thanks. It works and is clear now. I created a simple example to demonstrate just this feature. In general, to demonstrate a feature, for a first example it seems useful to include as little as possible other features and techniques, for example, in this case, no table syntax or other nice formatting, etc.--Patrick 10:20, 18 February 2007 (CET)

Installation issues

Problem

Great extension that I was using on a previous version of mediawiki. Now have moved my site and upgraded to:

  • Mediawiki 1.9.0
  • MySQL 4.1
  • DPL 0.9x

and I can't get it to work at all.

  1. I downloaded and copied DynamicPageList2.php from the manual page into extensions.
  2. added require_once("extensions/DynamicPageList2.php");

No good.. test page of

 <DPL> 
 category = CNS 
 </DPL>
just renders
<DPL> category = CNS </DPL> as text. 

tried to add Labeled Section Transclusion files with changes to localsetting.php

require_once("extensions/DynamicPageList2.php"); 
require_once("extensions/lst.php");
require_once("extensions/lsth.php");
require_once("extensions/compat.php");

Still no good.

I am not sure what else needs to be done...

test page for my site is here: [1]

Frank --58.106.107.217 04:01, 18 February 2007 (CET)

Answer

Sorry if the chapter on installation has not been clear enough:

  1. There are three source files which you must download and put into a common directory named DynamicPageList. So you end up with
    • yourwiki /extensions/DynamicPageList/DynamicPageList2.php
    • yourwiki /extensions/DynamicPageList/DynamicPageList2Include.php
    • yourwiki /extensions/DynamicPageList/DynamicPageList2.i18n.php
  2. You must invoke DPL from your LocalSettings.php with
    require_once("extensions/DynamicPageList/DynamicPageList2.php");
  3. You should run the database statement which creates an additional MySQL view if you want to use DPL statements which refer to uncategorized pages. Many installations work well without that and you can postpone this step until you really need it. If DPL cannot execute a DPL statement without that vies it will issue a warning.
  4. It is not necessary to install LabeledSectionTransclusion (lst.php, lsth.php); it is of no harm either. DPL comes with a slightly modified built-in version of that extension.
  5. There is a special feature in DPL which needs another extension: If you use page inclusion and want to use images as link symbols for the original source you must install the meta:LinkedImage LinkedImage extension. For details see there.

-- Algorithmix 84.58.222.19 07:54, 18 February 2007 (CET)

Followup

Just in case someone is having troubles too, and on the off chance they are as stupid as me...

on the DPL main page, right-click and save on the file names on the right will save what look like PHP files, but actually contain lots of HTML... Cut and paste is the way.

Cheers, and thanks for the answer.

Frank --58.106.107.217 08:36, 18 February 2007 (CET)

The error in your wiki seems to have a different cause as it refers to "Skin.php". Try to comment out the "requires once" line for DPL and check if the error is still there. -- 84.58.222.19 08:54, 18 February 2007 (CET)

Error

Ok, so it is up and running fine, but above any page which has a dynamicpagelist tag in it I get


Notice: Undefined variable: heading in /home/radiopae/public_html/includes/Skin.php on line 1645

9 times... then the page below which has worked fine

The section of Skin.php which it point to (first line is 1645) is...

					$bar[$heading][] = array(
						'text' => $text,
						'href' => $href,
						'id' => 'n-' . strtr($line[1], ' ', '-'),
						'active' => false
					);

I don't get this error on any other page, and only get it on pages with DPL tags. see here [2]

Thanks again, Frank. --58.106.107.217 09:01, 18 February 2007 (CET)

The reason is a programming error in Skin.php.
You MUST have a first line in your Mediwiki:Sidebar document which starts with a single "*" and the next line must start with "**". Use "* navigation" as first line and everything will be fine.
A look into the source code of Skin.php shows that there is a clear programming error in Skin.php: $heading is only set if "**" is found in Mediawiki:sidebar. But the variable $heading is used in another branch of an if statement; if you do not have "*" and "**" at the top of your document you will get the error for each line (i.e. 8 times in your case). I suggest that you report this as an error to the mediawiki project.
The reason why this happens only with DPL may lie in caching mechanisms. But it has nothing to do with DPL.
--Gero 15:04, 18 February 2007 (CET)

Thank you Gero and Algorithmix, worked perfectly.

Frank.

Labeled Section Transclusion

The manuel says:

It is not necessary to install LabeledSectionTransclusion (lst.php, lsth.php); it is of no harm either. DPL comes with a slightly modified built-in version of that extension.

Would it be possible to clarify exactly how the LST extension is modified here? Most importantly, does it still include all the same functionality?

If the full functionality is included in DPL, then perhaps we could "combine forces" in our lobbying efforts :-). I.e. since DPL was designed for Wikinews & LST for Wikisource, maybe we could submit a bug and bother people on IRC to get DPL applied live to both projects. :-) Dovi 08:28, 19 February 2007 (CET)

O.K., let me try:
  • includepage=mySectionMarker" works exactly like "#lst:myArticle|mySectionMarker" assuming that myArticle matches the selection criteria of the DPL statement
  • includepage=#myChapter" works exactly like "#lsth:myArticle|myChapter" assuming that myArticle matches the selection criteria of the DPL statement
  • there is no equivalent to "#lstx:" in DPL
  • the template based inclusion of DPL (which I personally find quite useful) has no equivalent in LabeledSectionTransclusion
  • the possibility to truncate included text portions at some text length limit and put a reference to the source chapter into the output does not exist in LabeledSectionTransclusion
  • the internal mechanism of loop detection is different in the DPL version; this was needed because I had problems with several DPL statements on one page (only the first one showed a result)

So what does this mean?

  • from a technical point you can install both extensions
  • from a user´s point of view the section tagging (#lst) and the heading transclusion (#lsth) work identical.
  • it makes sense to have LabeldedSectionTransclusion as a standalone tool if you want to transclude just one section of another article.
  • combined lobbying sounds good ...

--Gero 20:25, 19 February 2007 (CET)

Older MySQL and Older DPL

there is no need to keep older version
I must disagree, because my server is still on MySQL4.02 and I am unable to use the new feature. I may be minority but I do not believe that I am the only one in this situation. I would be very thankful and it would be very kind of you if you would find a time to modify the DynamicPageList2 to enable the folks with less capacity like me. I can see that new version is very useful but I still use the old version as there is no choice for me for the time being ...--Kohyin 22:22, 22 February 2007 (CET)
Sorry, but there is no way back to older MySQL releases. DPL 0.9 requires at least MySQL 4.2. Until you change you must use an older version of DPL2 (which you find on metawiki and in the subversion archive) -- Gero 16:30, 26 February 2007 (CET)

Mode

Is there any reason why mode is listed in the parameters twice? —Sledged (talk) 00:07, 9 June 2007 (CEST)

No, it was due to an error (the description of 'listattr' contained a wrong parameter at the macro call. 84.58.209.133 22:16, 10 June 2007 (CEST)