xif-fr / dokuwiki-plugin-catlist Goto Github PK
View Code? Open in Web Editor NEWDokuWiki plugin to list pages and namespaces recursively in nested lists
Home Page: https://www.dokuwiki.org/plugin:catlist
DokuWiki plugin to list pages and namespaces recursively in nested lists
Home Page: https://www.dokuwiki.org/plugin:catlist
To do.
After adding to any page, I get the error "The namespace does not exist"
I checked to make sure it's not ACL problem: I suspect it's not the case as it's the admin user that gets this error.
clicked the add page button.
it created a page called currentnamespace:name_I_chose
is that what was supposed to happen. to be clear I wan in ht notes: namespace and did not get notes:page_I_wanted. maybe I did something wrong?
catlist doesn't list pages in namespace.
Example:
Index - outside, inside
Let's say user has read permission on index pages for ns1 and ns2, and delete permission on namespace ns1:* and ns2:*
Wiki start page lists all available namespaces <catlist -noAddPageButton -noHead -maxDepth:2>
Output:
ns1
ns2
ns1 and ns2 links to their respective outside index
Index should list all pages and subnamespaces in ns <catlist ns1: -addPageButtonEach -noHead >
, but for this user index is empty. It is possible to create new pages by using "Add a page..." button, but neither new or already existing pages are listed.
When viewing with admin user (has delete permission on *) all lists are fine.
The various -exclude options are very useful, but is there a way to do the opposite, i.e. include only pages matching a regex?
For instance, if I have a namespace :cities which contains :cities:london:start
, :cities:paris:start
, :cities:berlin:start
and also :cities:paris:museums
, how would I show only the page :cities:paris:museum
in my catlist results?
I'm hoping for something like: <catlist :cities -includePage:"^museum$"
but at the moment I find myself doing things like <catlist :cities -noHead -exclupage:"(?=^((?!museum).)+$)">
.
Am I missing something, or is this a feature worth adding?
There's a line in syntax.php calling end() on the result of explode() - not allowed in modern PHP (I think since 5.3?)
if (is_null($main['title'])) $main['title'] = end(explode(':', $ns));
Needs to assign explode() to a variable first, like
if (is_null($main['title'])) {$nsparts = explode(':', $ns);$main['title'] = end($nsparts);}
I am trying to use -excludeOnName
to exclude my templates. However, I can't get it to work. The closest I can get is -excludeOnName template
but that will throw the following error:
The namespace podcast:ddop:notes: template does not exist
What am I doing wrong or is it a bug?
To do.
Hi,
I'm trying to use this plugin to show some pages of a namespace. Assume we have pagenames starting with "v" others starting with "b" and some starting with "r". I wanted to show the ones starting with 'v' so I used the following syntax:
<catlist -sortDescending -noHead -noAddPageButton -excludeOnName -exclupage:"!^v" -columns:2>
this gives me a result with all pages in this namespace, not what i expected.
When I remove the "!" like this:
<catlist -sortDescending -noHead -noAddPageButton -excludeOnName -exclupage:"^v" -columns:2>
I get a list of all pages except the excluded starting with "v" as I expect.
So what am I doing wrong here ? Did I missunderstand the Syntax ?
Any help is welcome...
Sorting by title is more useful than sorting by page ID, at least in the wiki I have.
The multiORPHANS plugin finds orphaned pages, but doesn't recognize catlist links.
It provides a hook so you can provide it with the semantic for catlist.
When included in the sidebar, the relative namespace will always refer to the position of the sidebar.
:root
|- sidebar
|- page_in_root
|-| :subnamespace
|- page_in_sub
|- ...
#sidebar
~~NOCACHE~~
<catlist .>
In the example structure given above (with root
and subnamespace
being namespaces), the sidebar will look the same when viewing page_in_root
and page_in_sub
.
It would be great if it would only render the "stuff" in subnamespace
if rendered within.
IndexMenu solves this with a "context" option (search for "context" here: https://www.dokuwiki.org/plugin:indexmenu https://github.com/samuelet/indexmenu , code most likely here: https://github.com/samuelet/indexmenu/blob/ac677d3079574e0ff70fd16eabbc8126338f3524/syntax/indexmenu.php#L92).
An alternate implementation strategy might be to use another symbol to refer to the context
, so instead of .
and ..
use something like *:..:
.
If its an ultra-low-hanging fruit I might look into crafting an PR if somebody guides me, but my php-fu is really weak.
Hi,
first, great plugin, use it a lot and we even removed all sidebar pages for your plugin. Since we need only the one on the root.
<catlist %%CURRENT_NAMESPACE%% -smallHead -sortAscending -sortByTitle>
these are the current options we use. The only thing not working is the "add a page..." button.
Because we use the %%CURRENT_NAMESPACE%% option, the button tries to add a page to the %%CURRENT_NAMESPACE%% namespace. And of course this namespace doesn't exist.
Hello,
I would like to use catlist plugin in the sidebar, where it would display the list of pages in the current namespace (the namespace relevant to the main page currently displayed).
I can provide a first PR with a simple implementation (that works at least for my need).
Are there others interested by such option? was this already planned for a future release?
Hello,
I have a bug on my wiki and maybe it is with catlist. But maybe not...
I use catlist to generate menus automatically. Some users have problems viewing these pages. They get an error 500 per moment, at other times the wiki is displayed but the article appears empty. The same behavior exists with different machines and browsers:
But a lot of other users haven't trouble...
In my Apache errors, I have the following mention:
PHP Fatal error: Class' SafeFn' not found in /var/www/dokuwiki/lib/plugins/catlist/syntax. php on line 238, referer: https://khaganat.net/um1/fr:tag:geographie:start
https://khaganat.net/um1/fr:tag:geographie:start being one of the pages that raises concerns.
Catlist and Dokuwiki are up to date. However, we are on a Debian Jessie server, so with PHP in version 5. In addition, this wiki has a lot of plugins, an obsolete theme, and includes a navigation bar (top) which I also regularly worry about: all these faults could also explain the display error.
The only Apache error mention catlist (for this part of the site), which is why I'm posting here, but I'll also try to solve the other problems.
Thanks a lot for your help and your good plugin :)
the add page button work fine with english file name. but if you use chinese file name, the file name will lost in the new page url.
test/test ==> test/test?do=edit
test/测试 ==> test/?do=edit
my conf:
useslash=1
fnencode=utf-8
userewrite=1
Hello,
I use catlist on all my wiki and it is really good.
It would be nice, in some cases, to be able to sort the pages by creation date (-sortByCreationDateAscending
and -sortByCreationDateDescending
) or last modification date (-sortByModificationDateAscending
and sortByModificationDateDescending
)
My suggestion are probably too long name for variable, but it is the idea !
HI,
thank you for your work on this usefull plugin.
I have a problem understanding the -excludeOnTitle option. Where do I specify what titles are to be excluded ?
I tried this to exclude pages in ns1:ns2 with first title starting with "Z_"
====== Test catlist plugin ======
<catlist ns1:ns2 -maxDepth:1 -sortAscending -sortByTitle -excludeOnTitle -exclupage:"^Z_.*">
but it does not work.
I think the example excludes pagenames starting wit "Z_*" but no glue how to specify to exclude based on the first title.
Any help will be welcome.
Distantly related to #1
Hi, I run a wiki with a private namespace where registered users have read-only rights and non-registered users have no rights. ACL is as follows:
* @ALL 1 # Everyone can read everything by default.
private:* @ALL 0 # No one can read from the private namespace...
private:* @user 1 # Except registered users.
On the main wiki page, I would like non-registered users to still be able to see the list of items in the private namespace - just not be able to access them. The plugin»catlist»hide_acl_nsnotr global option is unchecked. The main wiki page (at the root, accessible by non-registered visitors) includes the following syntax:
<catlist private: -noHead -forceHeadTitle -columns:3 -sortAscending -sortByTitle -noAddPageButton>
EXPECTED BEHAVIOR:
The syntax above should display the contents of the private namespace, even to non-registered visitors.
OBSERVED BEHAVIOR:
The contents of the private namespace are hidden from visitors, and shown to registered users. I believe I have occasionally been able to see the list as a non-registered visitor after logging in and out, changing browsers, etc. but this was inconsistent and I can no longer reproduce it.
Thank you for your help. Happy to give you user access to the wiki if you'd like to see for yourself.
When a page with a name which contains non-ascii characters is tried to add using this plugin, those characters will be converted to _
and we cannot make a page with the desired name.
Merging PR #10 can solve this problem.
Since the last update the sorting is broken, the config is missing the defaults (and metadata) for the config options sort_by_type
and sort_by_title
(they default to false, so it gets sorted by INODE).
An -include
option would be fine.
E. g. template:sprintdoc works like a charm with catlist for a dynamic Menu in the sidebar
As you can see at "https://demo.sprintdoc.de/sidebar" they have a menu structure which doesn't follow a given namespace:
===== Dokumentationspatterns @book-open-page-variant.svg =====
* [[pattern:start|Dokumentationsmuster]]
* [[usecase:start|Dokumentationsvorgänge]]
* [[patterns:help:anleitung|Dokumentation Patternanpassung]]
T use catlist for such a case an option -include:":patterns:help:anleitung"
would solve this.
Your catlist also works like a charm with template:bootstrap3.
The indexmenu plugin doesn't, it breaks <datatable>
and others. So catlist is a good replacement for indexmenu in template:bootstrap.
thank you for this plugin!
regards,
thomas
Since last update the descending sort is broken.
Your code $b = !$b
does not what you might think it does.
strcmp return <0 =0 or >0, so the correct code would be $b *= -1
.
Hi,
It could be great if an user didn't see pages he can't have access to.
Nevertheless, thank you for that great extension !
Best regards,
Etienne.
It would be great to have an option to hide the error message if the given doesn't exist.
Hi,
as a feature request, would it be possible to have an expand / contract as an option on folders
similar to the way the indexmenu plugin works?
Hi,
after update of dokuwiki and the plugins i used, i recognized that dokuwiki told me that there is an new catlist version from 2022-08-07 is available.
When i look in plugin.info.txt the date is on 2022-08-06
kind regards
Gerald
Noticed that when we added a new namespace, it was not showing up right away. Saw this is caused by the cache, and to use NoCache option. When I either turn on NoCache or use the NOCACHE options, the tree of namespaces and pages will have the second column of 2, 3, or 4 columns have print over displaying on itself. Seems to be just the top portion of the column. Hitting CTRL F5 2 or 3 times seems to clear it up, until you add another namespace and page.
Hey,
to add an Accordion you have to,
<ul id="accordion" class="catlist-nslist">
<script type="text/javascript"> $(document).ready(function(){ $(".catlist-nshead").click(function(){ // trigger $(this).next("ul#accordx").slideToggle("fast"); // blendet beim Klick auf "dt" die nächste "dd" ein. $(this).children("a").toggleClass("closed open"); // wechselt beim Klick auf "dt" die Klasse des enthaltenen a-Tags von "closed" zu "open". }); }); </script>
too.ul#accordion { display:none; }
to your custom.cssI'm not an professional, but it work for me fine.
Did you can add this feature to the new update?
Kind Regards #
Hello,
When plugin Catlist is added on the wiki, administration page (start?do=admin&page=config) become unavailable. If Catlist is deactivated, it is the same thing. The only way to retrieve the page is to uninstall the plugin.
I have the bug on my old wiki after an update, so I try on a fresh install, I this bug appear when I install catlist, and disappears when I uninstall it.
Hi
if u have for example 4 pages with the following titles (the first <h1>
)
1st page title: 1. some text
2nd page title: 2. some text
3rd page title: 11. some text
4th page title: 4. some text
the result after sorting is
replacing
$b = strcmp($a_title, $b_title);
with
$b = strnatcasecmp($a_title, $b_title);
in syntax.php Line 344
will do it but not tested for any side effects
br
When sorting by title, the sort order ("natural") does not behave as expected in other locales, e.g. German Umlauts (Ä
) are expected to be near their relevant neighbour (A
), but appear at the end of the list
The relevant code is at:
dokuwiki-plugin-catlist/syntax.php
Line 343 in 17186a0
I do not know PHP enough to understand which sorting function to use, maybe following thread helps:
https://stackoverflow.com/questions/9654907/php-array-sorting-with-accents
Hi, current version of catlist does not support namespaces anymore.
Before, you could add either a normal page (like 'newpage') or a namespace (like 'newns:').
If you try to add 'newns:' now, it will just add a new page and not a new namespace.
I love the plugin, however, I found an issue when using with Friendly URLs. When adding a new page from the listing the URL will be incorrect creating an unintended URL (https://mydomain.com/doku.php/podcast/ddop/s/test&do=edit). I am then presented with the "This topic does not exist yet" view then I have to click edit. When I do that page name becomes test_do_edit
. I believe a test should be done to see if the setting userewrite
is set to "DocuWiki Internal" then append a ?
instead of an &
.
Hello there and thanks for the very useful plugin!
Apparently, on mobile devices the lists appear like if they were very much zoomed, which for multi-column looks very weird and hard to read.. Does anyone know of a right CSS "patch" that would make it look OK on mobile browsers? Maybe making the columns independant floats: or something like this?
Thanks!
Hi,
Thanks for the plugin, super useful, but what triggers it to update, though? When I create a page, it doesn't update the list right away, I've done a couple of tests and it looks like it's only updating when I delete a page. Would it be possible for it to update everytime a new page is created?
thanks
When the setting "useheading" (in the Dokuwiki settings, Display section) is set to "Never", the text for links to pages default to the page name, rather than the first heading of that page. However, page links that are part of a catlist listing do not behave in this way.
I suggest catlist should at least obey the "useheading" setting by default. It might be useful to also add plugin-level settings to control this behavior. As it currently stands, there appears to be no way to make catlist show page names.
Hi
Could you please adjust the plugin , so that it will list the files with extensions .ascii,.pdf,.ppt,.doc,.docx,.odt etc
Hi,
I have many namespace and users with restricted ACL.
If "hide_acl_nsnotr" is enable, user with no acces have the head of restricted namespace.
For me, it is not good, for confidential raison.
Turning on 'Disable page cache where catlist is used' in the plugin configuration settings
(Which, in turn, adds the line '$conf['plugin']['catlist']['nocache'] = 1;' to the conf\local.php)
Gives the PHP warning: Undefined array key "title" in [...]\lib\plugins\catlist\syntax.php on line 403
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.