Extension talk:SubPageList

From MediaWiki.org
Jump to: navigation, search
Start a new discussion

Contents

Thread titleRepliesLast modified
Working with older versions of MediaWiki ?311:47, 23 May 2012
Subpages of Parent Page to be listed423:03, 23 February 2012
Number of subpages?215:30, 16 January 2012
Error Deleting Pages409:44, 28 December 2011
Using Slash / in a page name318:44, 3 October 2011
Showing siblings and the parent313:36, 23 September 2011
Sub-sub pages not showing519:11, 13 June 2011
Option and confusion about capital letters Yes/No versus yes/no113:15, 26 May 2011
Fatal error: Call to undefined method DatabaseMysql::buildLike()423:21, 13 April 2011
Broken DB query in Postgres 8.3415:00, 8 March 2011
page & parent parameter and Magic Words402:46, 3 March 2011
No automatic update209:43, 24 February 2011
kidsonly parameter bug1014:34, 14 February 2011

Working with older versions of MediaWiki ?

Hi. I have a 1.15.1 Wiki and when I use this extension I get a 500 Error on my page. Is it not compatible ?

92.103.239.24809:49, 23 May 2012

On the extension page it says that the extension needs MediaWiki 1.16 at least, so I guess you need to update MediaWiki to make it compatible.

After a Server Error 500 you will also find information in the Apache Log (if you have access to it).

88.130.82.12310:08, 23 May 2012

If I could update I wouldn't ask here. The thing is, SubPageList3 works on that version of Wiki but not this extension. Yes I find some of the features this one has quite interesting and would like to know if it would be a lot of work to make it work on 1.15.x... Thanks for your answer ^_^

92.103.239.24811:44, 23 May 2012

Ok so version 0.4 Is compatible with 15.x. So I'll try to go with that. Thanks.

92.103.239.24811:47, 23 May 2012
 
 
 

Subpages of Parent Page to be listed

Can we have a simple additional parameter field that will list the subpages of the parent page. Currently by default the subpages of the current page is listed. A similar method to have subpages of parent page to be listed would be optimal. If there is another simple method please let me know. Thank You!

Wikimanz (talk) 00:49, 23 February 2012 (UTC)

Wikimanz (talk)00:49, 23 February 2012

You can use the page parameter and set it to the name of the parent page. Not sure how you can easily obtain the name of the parent page though, but would be very surprised if it was not possible. I suggest asking on the wikitech-l list or #mediawikiconnect irc.

Jeroen De Dauw (talk)13:01, 23 February 2012

Thanks Jeroen, as you suggested at the IRC I learned that I can use {{#titleparts:}}from ParserFunctions extension

This parser function allows for more complex splitting of page names and might be useful when one wants to display only a specific part of the full page title.
example. {{#titleparts: one/two/three/four|1|2 }} → two

However, after that I learned that the actual name of the basepage is what I need for this extension SubPagelist. {{BASEPAGENAME}}. However the use of {{BASEPAGENAME}} in the page page name parameter does not work for me either in the tag or parser function of this extension. {{BASEPAGENAME}} by it self does output the correct base page name and when used in the parser function of this extensions I get a page does not exist message outputting the correct base page name. I have mediawiki 1.18.1 with the most recent Validator and SubPageList.

Few of what I tried:

<subpages page="{{BASEPAGENAME}}" format="ul" pathstyle="no" sortby="lastedit" sort="asc" showpage="yes" kidsonly="yes"/>
 or
{{#subpages:
| page={{BASEPAGENAME}}
| format=ul
| pathstyle=no
| sortby=lastedit
| sort=asc
| showpage=yes
| kidsonly=yes
}}

P.S I also saw similar problem in another extension flashmp3 extension, where I was able to produce an external link with magic words like {{BASEPAGENAME}} to link to an S3. Although it does output the correct page name and links it never worked when I used it in tags for the extension.

Wikimanz (talk)20:14, 23 February 2012

Works for me. At least the parser function. This is with the latest version of the extension and Validator. Are you sure you got the latest version of Validator?

Jeroen De Dauw (talk)20:36, 23 February 2012

Solved - Notice!

I tested my other extensions to see if there is a conflict with SubPageList and I found out that the cause of this error was the extension SubPage Fun. I had installed this extension along with SubPageList and although SubPageList works when I input the actual page names into the tag and parser functions of SubPageList, it didn't work when I used Magic words like {{BASEPAGENAME}}. I'm not sure if this can be replicated by others but if is a known conflict it might be useful to mention it on the extension page so others won't have the same problem I did.

Thanks Jeroen!

Wikimanz (talk)23:03, 23 February 2012
 
 
 
 

Number of subpages?

Any chance to implement a magic word returning the number of (direct) subpages of a page?

85.180.152.7712:28, 10 August 2011

Why a magic word and not some parser function? When implementing such a thing, it'd be not hard to have several variations on that, for example the number of direct parent pages, the number of non-direct subpages, or the number of all pages in the tree. This could be done w/ a parser function and some parameters, but not a magic word.

In any case, what's the exact usecase? Convince me this feature would be useful to have :)

Jeroen De Dauw22:41, 10 August 2011

It would be nice to use those functions in parser functions like #if: to choose the formatting of the subpages. Especially, on 0 subpages I would like to omit the message: 'Page "topPage" has no subpages to list'. A conveniant but maybe expensive alternative to the last use case would be to allow to configure the error message to the empty string, and use the {{#subpages:}} directly in the if condition.

Tomaschwutz15:27, 16 January 2012
 
 

Error Deleting Pages

I'm now getting the following error when trying to delete any page on the wiki. Any ideas why??

Catchable fatal error: Argument 1 passed to SPLHooks::onArticleDeleteComplete() must be an instance of Article, instance of WikiPage given in /home/racecari/public_html/w/extensions/SubPageList/SubPageList.hooks.php on line 43

Scott D06:04, 27 December 2011

Are you using the latest version? I think this is already fixed.

Jeroen De Dauw11:53, 27 December 2011

Hi Jeroen, it shows up as 0.4 on my versions page. Downloaded from link on extension page: https://code.google.com/p/subpagelist/downloads/list?can=1

I tried version 0.3 also, same thing. Initially I had an earlier version of Validator but I am now using the latest one (downloaded with your package)0.4.9 alpha. No change there either.

- Scott

edit, i used the .zip download

Scott D12:03, 27 December 2011

Fix was made several months ago, but I did not make a release since then, so just did that now. Please try the new version.

Jeroen De Dauw16:11, 27 December 2011

Thanks Jeroen, limited testing shows all OK sofar. Thanks for a very handy extension!

- Scott

Scott D09:44, 28 December 2011
 
 
 
 

Using Slash / in a page name

In my example a user created a page with a slash inside its name: "Connect RS232 over TCP/IP" When i call my subpage-list i get the error "Page "Connect RS232 over TCP" does not exist". So it's pretty clear that the page name gets cutoff after the slash. Here's the parameters that i've used: {{#subpages:| page={{#titleparts:{{BASEPAGENAME}}|1}} | format=ul | sortby=title | sort=asc | showpage=yes | kidsonly=no }} What could be the problem here? is this a bug or can it be circumvented?

195.141.78.24112:15, 3 October 2011

Oh and just tested if the "titleparts" is causing the problem. The answer is no.

{{#subpages:| page=Extension talk:SubPageList/Using Slash / in a page name/reply 

delivers the same error. (Mike)

195.141.78.24112:20, 3 October 2011

Sorry, meant to say:

 {{#subpages:| page={{BASEPAGENAME}} 

delivers the same error as:

 {{#subpages:| page={{#titleparts:{{BASEPAGENAME}}|1}} 

(Mike)

195.141.78.24112:22, 3 October 2011
 

The part after flashes is either a sub page or not, this extension assumes it is. You can't have both without having some additional system for specifying if something is a sub page or not.

Jeroen De Dauw18:44, 3 October 2011
 

Showing siblings and the parent

It would be nice if the subpage could display its siblings and the article above it. Also, when the "showparent" or "showpage" option is selected, the text is not displayed clearly. The subpages overwrite it. There is a module called Subpages Fun that includes additional subpage variables. Maybe that could be used to implement this idea.

Zzmonty01:27, 9 August 2011

Figured out how to display the parent and the siblings on a subpage:

   {{#subpages:| page=Extension talk:SubPageList | showpage=yes}}

The titleparts displays the siblings, and then the showpage displays the parent. Hope this is useful for somebody else.

Zzmonty02:21, 9 August 2011

Forgot to set the nowiki

{{#subpages:| page={{#titleparts: {{BASEPAGENAME}}| 1 }} | showpage=yes}}

Hopefully it is display correctly now.

Zzmonty02:23, 9 August 2011

Thanks for mentioning that. Very helpful indeed and just what i was looking for to display huge project structures. :) (Mike)

195.141.78.24113:36, 23 September 2011
 
 
 

Sub-sub pages not showing

I've installed the plugin and it works ok for top level pages with sub pages, but not for sub-sub pages. So my layout is

a > b > c

It just shows a & b on page a (missing c), and shows nothing on page b. Am I doing something wrong? Thanks

165.1.1.421:26, 4 April 2011

What version of SubPageList are you using? Also, can you link to where this is occurring?

Jeroen De Dauw22:00, 4 April 2011

I have a similar issue using the recent 0.3 Version of SPL. Using the following structure:

Mainpage

SubPage1
SubPage2

Then i add a Subpage1.1 to Subpage1 and go back to see the hierarchy. It now should show like:

Mainpage

SubPage1
SubPage 1.1
SubPage2

...but my listing is still showing no childs of Subpage1. However the new child is shown when i click on SubPage2.

195.141.78.24112:58, 8 June 2011

So SubPage 1.1 show when you click SubPage2? Sorry, but this is to vague for me to debug; can you link to where this occurs and write down the steps to reproduce?

Jeroen De Dauw17:37, 8 June 2011
Edited by another user.
Last edit: 19:06, 13 June 2011

Can't link you to an example - internal wiki - sorry. But you already understoof what i meant.

  1. Have one Main Level Page - MyPage
  2. Create two Sub Level Pages - MyPage\SubPage1 & MyPage\SubPage2
  3. Add a child to the first Sublevel page MyPage\SubPage1\Child1
  4. Browse back to MyPage\SubPage1 = Child1 is not shown
  5. Browse to either MyPage or SubPage2 = Child of SubPage1 is shown

This is what i saw yesterday right after creating the Child (3rd Level Page). However, what i saw today is: Display of Subpages is correctly up to 2 levels. Once you visit the 3rd level (Child1 in my Example), the Navigation structure only shows a concatenated string of "MyPage\SubPage1" and the currently active child.

Here is my configuration if that helps:

{{#subpages:| page={{BASEPAGENAME}} | format=ul | sortby=title | sort=asc | showpage=yes | kidsonly=no }}

I guess the BASEPAGENAME-part is messing up the navigation. I need it though since i use your addon in templates for all of my pages. And as foresaid: its working fine as long as i don't use a 3rd Level. :)

195.141.78.24111:53, 9 June 2011
This is what i saw yesterday right after creating the Child (3rd Level Page). However, what i saw today is: Display of Subpages is correctly up to 2 levels.

Sounds like a caching issue. The sub page lists do NOT refresh automatically in most cases, they only do (since the last version of this extension) for top level pages when editing any of their subpages. Hit the refresh button in the UI, or append ?action=purge to the page title in your browsers url bar when viewing the page and hit enter.

Jeroen De Dauw19:11, 13 June 2011
 
 
 
 
 

Option and confusion about capital letters Yes/No versus yes/no

Hi,

While using checkboxes to decided whether to display parents/kidsonly or not, we came in trouble with the capital letter writing of Yes/No. That is using checkboxes automatically returns Yes/No and not yes/no and it seems that the extension only understands small letter yes/no while using Yes/No as parameters the extension ignored the choices.

Tested version, SubPageList (Version 0.3) (r88881).

MWJames08:36, 26 May 2011

Indeed; issue confirmed. You found a bug in Validator actually. It's fixed now. Updating it from SVN should resolve your problem :)

212.123.29.15213:15, 26 May 2011
 

Fatal error: Call to undefined method DatabaseMysql::buildLike()

After installing SubPageList, and adding the default plain-jane tag to a page that has subpages, I get this error:

  • Fatal error: Call to undefined method DatabaseMysql::buildLike() in /var/www/extensions/SubPageList/SubPageList.class.php on line 209

Did I miss something in the configuration?

Glitch2517:33, 13 April 2011

What version of MediaWiki are you using?

Jeroen De Dauw21:56, 13 April 2011

Mediawiki 1.15.3 Let me know if you need anything more.

Glitch2522:55, 13 April 2011

Apparently the missing method was added in MediaWiki 1.16. I corrected the required MediaWiki version on the extension page and suggest you update to the latest MediaWiki release if possible.

Jeroen De Dauw23:20, 13 April 2011

Understood! Thank you much!

Glitch2523:21, 13 April 2011
 
 
 
 

Broken DB query in Postgres 8.3

I ran into an issue when trying to test this extension. I thought I would include it on the discussion page for any others who may encounter the problem in the future. If this isn't the appropriate place, let me know, and I'll make the adjustment accordingly.

A query in SubPageList.class.php was making terrible noise and prevented the extension from working with Postgres 8.3 on a FreeBSD server.

I received the following output:

Warning: pg_query() [function.pg-query]: Query failed: ERROR: operator does not exist: ` text LINE 1: ...e_namespace = '0'
 AND page_is_redirect = '0'AND (`page_titl... ^ HINT: No operator matches the given name and argument type(s).
 You might need to add explicit type casts. in /var/www/wiki/includes/db/DatabasePostgres.php on line 584

Looking in SubPageList.class.php I found the offending line:

$conditions[] = '`page_title` LIKE ' . $dbr->addQuotes( $dbr->escapeLike( $title->getDBkey() ) . '/%' );

The following minor edit fixed the problem:

$conditions[] = 'page_title LIKE ' . $dbr->addQuotes( $dbr->escapeLike( $title->getDBkey() ) . '/%' );

Hope documenting this somewhere helps someone out there.

Swos20:52, 4 March 2011

Thanks for pointing this out! I just fixed it on SVN, so the fix will be in the next release, which I will make in one of the next days :)

Jeroen De Dauw22:24, 4 March 2011

Sounds great! Thanks for maintaining this extension!

Swos04:58, 5 March 2011

I just released v0.3, let me know if you find any more issues :)

Jeroen De Dauw20:47, 5 March 2011

Thanks a lot. Will download it shortly and test alongside other extensions I need to install!

Swos15:00, 8 March 2011
 
 
 
 

page & parent parameter and Magic Words

I'm currently trying to establish Subpagelist as an output in my whole wiki using templates. So basically this means that my "parent" page for Subpages can be variable. MediaWiki Syntax already provides me with a path, which *should* be allowing me to show my directories in all wiki pages.

The code is:

<splist 
 page={{BASEPAGENAME}}
 showpath=no
 sort=asc
 sortby=title
 liststyle=ordered
 showparent=yes
 kidsonly=yes
/>

I have tried this earlier with SubPageList3 but with the same results: Wiki Magic Words (as the one here used in the first line) seem to be fully ignored or simply read as string. In result i only see the subpages of my current page and not the "full" directory down to the basepage. Is there a way to achieve this?

212.47.167.17014:55, 24 February 2011

It seems to be working in the latest version. Are you using an older one?

Jeroen De Dauw22:18, 27 February 2011

0.2 according to my Special:Versions page. I cannot use SVN here due to company restrictions. Is the download provided at https://code.google.com/p/subpagelist/downloads/list up to date?

I am also using multiple a nested template to call this function. Basically i have a "SubPageDisplay" on bottom of each of my articles. Its a box which contains 2 templates: "AddSubPageForm" and "ListSubpages", last of which contains exactly the code shown above. However when visiting subpages my shown root is always the currently opened subpage itself instead of the required basepage. Could this nesting be a problem?

Another idea could be the fact that i just recently used Subpagelist3. Could there be some leftovers (caches, tables) that prevent this from working?

Btw, the Parameters chapter is lacking a column for "valid parameters". Could be helpful to prevent misuse of this good extension. :) (Mike)

212.47.167.17015:46, 1 March 2011

Issue resolved. Seems to be a bug related to the old "splist" parser command. The following code is identical in behaviour to mine above, but works...

{{#subpages:
| page={{BASEPAGENAME}} -- example in the documentation is missing a pipe here
| format=ul
| sortby=title
| sort=asc
| showpage=yes
| kidsonly=yes -- This behaviour is inverted, i think that´s a known issue already
}} 

...while my code sample above doesn´t. This is either a parsing bug or intended changed behaviour towars SubPageList3 since my code hasn´t changed after the extension replacement. However i`m happy with the result now. Thank you for the support. :) (Mike)

212.47.167.17016:04, 1 March 2011

The fact that it's working in the tag extension for me is probably related to changes in the Validator extension, of which you can obtain the latest release here. In any case, some small issues have been fixed since version 0.2 of SubPageList, so I probably should release 0.3 soonish :)

Jeroen De Dauw02:46, 3 March 2011
 
 
 
 

No automatic update

When I add a new subpage the tree doesn't update until I hit the save button on the page containing the tree.

I use the following software: SubPageList (Version 0.2) Mediawiki 1.16.1

153.98.68.19710:04, 23 February 2011

This is the intended behaviour. MediaWiki caches the content of a page until it's saved or otherwise invalidated. This has little to do with the SubPageList extension, as any parser hook or tag extension behaves like this.

Jeroen De Dauw14:13, 23 February 2011

I discovered it myself before I read your reply. I'll provide a quick link to purge the page from the cache in the sidebar then.

Thanks anyway

153.98.68.19709:43, 24 February 2011
 
 

kidsonly parameter bug

I had installed both this extension and Extension:SubPageList3 on the same wiki. It seems that both got into each others way because all of a sudden the kidsonly parameter (set to "yes") didn't work anymore with both extensions. Disabling this extension seems to have amended that issue.

Nakohdo07:56, 28 January 2011

The idea is that you use only a single sub page list extension, not multiple. try only using SubPageList. That should work, and if it doesn't, this is a bug, which you should report. SubPageList being backwards compatible with SubPageList3 means that when using SubPageList3, and replacing it with SubPageList, the wikitext should still function the same.

Jeroen De Dauw11:53, 28 January 2011

Thanks for the quick reply! Actually that was only for testing purposes ;-) Will try your suggestion.

Nakohdo14:59, 28 January 2011

I disabled SubPageList3 but the kidsonly parameter doesn't work anymore, with neither syntax (tag or parser function) so it definitely looks like a bug.

Looks like the parameter gets the kind of double negation wrong:

kidsonly = yes will show all descendants, while kidsonly = no won't show any.

hth

BTW Which extension provides this cool forum style discussion page?

Nakohdo15:21, 28 January 2011

Oops.. I fixed the negation issue on SVN, so it'll be fixed in the new release.

This threaded discussion page works via LiquidThreads

Jeroen De Dauw18:11, 28 January 2011

Thanks for the fix. I grabbed the code from SVN and the bug seems to be gone.

However I get another error message:

Call to undefined method SubPageList::parseWikitext() in /extensions/SubPageList/SubPageList.class.php on line 157

Seems the old parse() function is gone and not yet replaced by a new parseWikitext() function.

Nakohdo14:50, 31 January 2011
 
 
 
 
 
Personal tools
Namespaces

Variants
Actions
Navigation
Support
Download
Development
Communication
Print/export
Toolbox