The rendering creates a table of list items (incorrect HTML)
edelegationen opened this issue · 14 comments
It looks like the output of the plugin creates an HTML table where each table cell contains a ul / li element. With the settings parameters table/list I would expect the output to be either table > tr > td OR ul > li. Not both.
Could you paste the pagelist-syntax you are using and the HTML-output?
This is would I get: http://pastebin.com/A0CKF1Md
This would be good if the user had selected table as the output format. But if the user selects list, it should not have any table elements. It should just do
Perhaps this is only possible if just pagenames are displayed and not the dates or users?
Coming back to update and realized that my last post was useless.
In any case, I was working on a deadline and wanted pagelist to work with wrap to make lists into columns, like the mediawiki category pages. As such, I went through the code to see why the plugin was generating tables that look like lists instead of actual lists as well as how intricate and involved the changes might be (I have some general programming experience, but couldn't write this plugin from scratch). After mucking about for a bit, I found and altered the statements that generate the lists. Now, when $this->style == 'list', it actually generates an unordered list. I only tested it with page names, as I didn't require dates, users, etc. It worked for me and the HTML code generated looks proper. It shouldn't be too difficult to make the rest of it work, if it doesn't.
TL;DR: I think I fixed this issue. http://pastebin.com/1HDytYdh
The list style needs the table around the output to displays the other columns (date, user, description, ...) next to the pagename. I assume the current structured output couldn't be well realized with <li><ul>
elements only.
Abandon the table elements would be only applicable, if the following flags are given:
<pagelist&list&nodate&nouser&nodesc&nocomments¬ags>
Would it be possible to have this as a separate option from list then? With a warning or whatever is necessary telling the user that it will only work with page names.
Alternatively, I believe it should be possible to just concatenate the items when displaying them as a list. It might not be as structured, but you could format it so that they look different or have dashes between elements.
I would add it as another option for the style parameter. Like <pagelist&list-simple>
which skips most of the other flags and just outputs the pagenames.
I believe that would resolve this issue and satisfy my use case. Keep up the good work.
EDIT: This should work with the tag plugin, right? So I can use something like {{topic>tag1&list-simple}}
?
This is a patch for your helper.php: https://gist.github.com/1579950
After applying it you could use the following syntax:
``<pagelist&simplelist>
- [[..:blog:|Blog Plugin]]
- [[..:discussion:|Discussion Plugin]]
- [[..:editor:|Editor Plugin]]
- [[..:tag:|Tag Plugin]]
- [[..:wrap|Wrap Plugin|This is shown in the description cell]]
``
I won't patch this in the repository, because it's imho not a real benefit for the user. You can do the same by just using DokuWikis list syntax and adding page links.
I think it is a real benefit for the user. This allows me to tag pages with the tag plugin, list them with pagelist, and wrap them with wrap. This leads to dynamically generated page lists that don't have to be in a single column. The advantage being that long lists can be displayed in less vertical space. It becomes a rather convenient way to emulate the mediawiki category pages, which is how I am using the plugins.
EDIT: Not patching this into the repository will also affect my ability to update the plugin, correct?
Ah I see. Didn't thought about the tagging thing. I'll put it in the repository tomorrow. Please test it first.
Here is the complete file: http://pastebin.com/2EAPpT7T
Just replace it with your current helper.php
I have three distinct lists on one page. The first list displays fine. The second list includes the first. The third list includes the first two. Each subsequent list is indented. i.e. the third list has the first list at level 1, the second at level 2, the third at level 3. I included an example at the end. I believe this is due to an error on line 280, which reads if(!$this->style != 'simplelist') {
. I believe this is being interpreted as a double negative, but I'm not skilled with php so I could be wrong. Furthermore, my lists seem to be ending with </table>
instead of </ul>
, which makes this seem more likely.
Example:
- item1
- item2
- item3
EDIT: It is probably more than this, the third list includes the items from the first two, so they are being included when they shouldn't for some reason.
I think I found the error that's causing the lists to repeat. Line 193 $this->doc .= '<ul>';
. It's concatenating with $this->doc
instead of creating a new $this->doc
Any update on these bugs?
No.