Topic on Project:Support desk

Jump to navigation Jump to search

Showing a complete table of contents (categories and pages)

8
Grmblfx5 (talkcontribs)

Hello,

on my wiki pages, I used the extension "NiceCategoryList2" to get a complete TOC on my starting page, as you can see here:

http://www.psych-med.de/wiki/index.php?title=Hauptseite

Unfortunately, the extension isn't maintained anymore, so I need an alternative after updating.

I tried "categorytree" and "DynamicPageList3" but wasn't able to get the same result (categories as headings, subpages as links).

For "DynamicPageList3" I studied the manual but didn't find a support page or forum to ask.


Can anyone tell me if or how I can get a complete table of contents on a wiki-page?


Thank you!

Jonathan3 (talkcontribs)

I'm pretty certain this would be possible with DPL3 - I need to do something similar and if I manage it I'll add a message here.

Jonathan3 (talkcontribs)

Just read your comments on your other topic. It's definitely possible to use recursion in DPL3 to display the category/page structure from a named top category (or alternatively to use separate sub-templates/queries for whatever level you want to go down to). I've got this working but it is similar to CategoryTree in that it displays the categories as links too, which is not what you want. I hope it will be possible to add some sort of "if" statement in the middle of the DPL3 query to show the categories as text (maybe even headings) rather than links. Maybe wishful thinking.

188.99.221.120 (talkcontribs)

Hi Jonathan,

thank you for your encouragement. I'm also quite sure that it must be possible, but didn't get it working so far. I tried different statements, but only the pages of the top category are shown in a rather unclear way. If you can manage it, I would be very happy for a solution.

Unfortunately, there's no support from the authors or other users of the extension, at least I couldn't find one.


188.99.221.120 (talkcontribs)

...and can you post/show me your query using recursion?

Jonathan3 (talkcontribs)
Grmblfx5 (talkcontribs)

Hi Jonathan,

I tried a lot of things, but didn't get in the near of what I want.


Here's what I use at the moment:

{{#tree:

{{#dpl:category=Medizin|format=,**,%PAGE%\n,}}}}


Do you (or any other) have any hints for showing a complete TOC or at least a recursive list of categories/sites?


Thanks!


Jonathan3 (talkcontribs)

Have a go at the following. I haven't got round to changing the category names to un-linked text (in the meantime, I have the category pages redirect to one of their content pages). I don't think I've tested it completely but it should be good enough to start off with.

{{create tree|{{{catname|}}}}}

Template:Create tree

<includeonly>{{#dpl:
|debug=1
|category={{{1|}}}
|redirects=include
|skipthispage=no
|eliminate = all 
|format=,*[[%PAGE%|%TITLE%]],\n²{Create tree sub¦%TITLE%}²,
}}</includeonly>


Template:Create tree sub

<includeonly>{{#dpl:
|debug=1
|category={{{1|}}}
|redirects=include
|skipthispage=no
|eliminate = all 
|format=,**[[%PAGE%|%TITLE%]],\n²{Create tree sub sub¦%TITLE%}²,
}}</includeonly>


Template:Create tree sub sub 

<includeonly>{{#dpl:
|debug=1
|category={{{1|}}}
|redirects=include
|skipthispage=no
|eliminate = all 
|format=,***[[%PAGE%|%TITLE%]],\n,
}}</includeonly>
Reply to "Showing a complete table of contents (categories and pages)"