Difference between revisions of "Talk:Resultsheaderwithcolumns"

From FollowTheScore
Jump to: navigation, search
m (Reply: link)
 
(9 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 
Any reason why <tt>columns</tt> doesn't work right when used in a template? -—[[User:Eep²|Eep²]] 13:40, 2 February 2010 (UTC)
 
Any reason why <tt>columns</tt> doesn't work right when used in a template? -—[[User:Eep²|Eep²]] 13:40, 2 February 2010 (UTC)
  
Probably yes ;-)
+
:Probably yes ;-) The question might be: is it "bug or feature"? What problem are you exactly talking of? [[User:Gero|Gero]] 18:03, 2 February 2010 (UTC)
The question is might be "bug or feature"? What problem are you exactly talking of? [[User:Gero|Gero]] 18:03, 2 February 2010 (UTC)
+
 
 +
::Well, you know how DPL can be called as a tag (<tt><nowiki><dpl>...</dpl></nowiki></tt>) or as a template (<tt><nowiki>{{#dpl:...}}</nowiki></tt>)? Well, using <tt>columns</tt> inside the DPL template causes the wiki table markup to show but fails to render as a table:
 +
{{#dpl:
 +
|category=African_Country
 +
|columns=3
 +
}}
 +
 
 +
Which, for some reason, renders like this on my wiki:<pre><nowiki>{|
 +
 
 +
|
 +
 
 +
    * Entry
 +
    * Entry
 +
    * Entry
 +
 
 +
|valign=top|
 +
 
 +
    * Entry
 +
    * Entry
 +
    * Entry
 +
 
 +
|valign=top|
 +
 
 +
    * Entry
 +
    * Entry
 +
 
 +
|valign=top|
 +
 
 +
|}</nowiki></pre>
 +
But I haven't upgraded in a while so that might be the problem. -—[[User:Eep²|Eep²]] 03:37, 3 February 2010 (UTC)
 +
 
 +
:So I upgrade to the latest version, but now I get this error:
 +
Fatal error: Call to a member function getText() on a non-object in .../httpdocs/wiki/includes/Parser.php on line 3715
 +
: Any ideas? All I did was copy all of DPL's files to a new extensions subfolder, then add this to LocalSettings.php:
 +
require_once("$IP/extensions/DynamicPageList/DynamicPageList2.php"); #4
 +
: And commenting out the line for the old version:
 +
#require_once("$IP/extensions/DynamicPageList2/DynamicPageList2.php"); #4
 +
:-—[[User:Eep²|Eep²]] 04:10, 3 February 2010 (UTC)
 +
 
 +
:: I notice my user page test also generates a similar error:
 +
Fatal error: Call to a member function getNamespace() on a non-object in /www/htdocs/w0057617/dpldemo/extensions/SimpleForms/SimpleForms.php on line 457
 +
:: —[[User:Eep²|Eep²]] 04:27, 3 February 2010 (UTC)
 +
 
 +
=== Reply ===
 +
I can reproduce the effect you describe if I use a resultsheader without trailing newline:
 +
 
 +
{{#dpl:
 +
|resultsheader=%PAGES% pages in total.
 +
|category=African_Country
 +
|columns=3
 +
}}
 +
 
 +
Is that the reason?
 +
 
 +
The problem with <tt>getText()</tt> could lie in the version of your MW version. MW changed the interface (somwhen in 1.13 I believe) - so you might need a more recent version of MW to use the latest version of DPL.
 +
 
 +
BTW:
 +
In my opinion the example in the manual works correctly - for testing I just put in a category name which exists in the current wiki, like 'Fictitious country':
 +
 
 +
<DPL>
 +
  category=Fictitious country
 +
  addpagesize=true
 +
  ordermethod=size
 +
  mode=userformat
 +
  listseparators={|class=sortablewikitable id=2\n!Rank\n!Article\n!Bytes\n|-,\n|%NR%.\n|[[%PAGE%]]\n|align=right|%SIZE%,\n|-,\n|}
 +
  count=12
 +
  rows=2
 +
</DPL>
 +
 
 +
[[User:Gero|Gero]] 15:41, 4 February 2010 (UTC)
 +
 
 +
:Dunno about the trailing newline but since I don't feel like upgrading MW now, I'll just use <tt><nowiki><div style="-moz-column-count:2;column-count:2;"></nowiki></tt> in <tt>resultsheader</tt> and <tt><nowiki></div></nowiki></tt> in <tt>[[resultsfooter]]</tt>. —[[User:Eep²|Eep²]] 10:46, 6 February 2010 (UTC)

Latest revision as of 11:47, 6 February 2010

Any reason why columns doesn't work right when used in a template? -—Eep² 13:40, 2 February 2010 (UTC)

Probably yes ;-) The question might be: is it "bug or feature"? What problem are you exactly talking of? Gero 18:03, 2 February 2010 (UTC)
Well, you know how DPL can be called as a tag (<dpl>...</dpl>) or as a template ({{#dpl:...}})? Well, using columns inside the DPL template causes the wiki table markup to show but fails to render as a table:


Which, for some reason, renders like this on my wiki:
{|

|

    * Entry
    * Entry
    * Entry

|valign=top|

    * Entry
    * Entry
    * Entry

|valign=top|

    * Entry
    * Entry

|valign=top|

|}

But I haven't upgraded in a while so that might be the problem. -—Eep² 03:37, 3 February 2010 (UTC)

So I upgrade to the latest version, but now I get this error:
Fatal error: Call to a member function getText() on a non-object in .../httpdocs/wiki/includes/Parser.php on line 3715
Any ideas? All I did was copy all of DPL's files to a new extensions subfolder, then add this to LocalSettings.php:
require_once("$IP/extensions/DynamicPageList/DynamicPageList2.php"); 	#4
And commenting out the line for the old version:
#require_once("$IP/extensions/DynamicPageList2/DynamicPageList2.php"); 	#4
-—Eep² 04:10, 3 February 2010 (UTC)
I notice my user page test also generates a similar error:
Fatal error: Call to a member function getNamespace() on a non-object in /www/htdocs/w0057617/dpldemo/extensions/SimpleForms/SimpleForms.php on line 457
Eep² 04:27, 3 February 2010 (UTC)

Reply

I can reproduce the effect you describe if I use a resultsheader without trailing newline:

7 pages in total.{| |

|valign=top|

|valign=top|

|valign=top|

|}


Is that the reason?

The problem with getText() could lie in the version of your MW version. MW changed the interface (somwhen in 1.13 I believe) - so you might need a more recent version of MW to use the latest version of DPL.

BTW: In my opinion the example in the manual works correctly - for testing I just put in a category name which exists in the current wiki, like 'Fictitious country':

Rank Article Bytes
1. DPL Example 007 main page 1 114
2. Nigunda Test 454
Rank Article Bytes
3. Somango 663
4. Nigunda 1119


Gero 15:41, 4 February 2010 (UTC)

Dunno about the trailing newline but since I don't feel like upgrading MW now, I'll just use <div style="-moz-column-count:2;column-count:2;"> in resultsheader and </div> in resultsfooter. —Eep² 10:46, 6 February 2010 (UTC)