samuelet / indexmenu

A dokuwiki plugin to show a customizable and sortable index for a namespace.
http://dokuwiki.org/plugin:indexmenu
GNU General Public License v2.0
44 stars 42 forks source link

One character filename pages are not indexed #273

Closed barredespace closed 7 months ago

barredespace commented 8 months ago

Hello,

I use IndexMenu with a big glossary that I directly upload as txt files (~3000 files) and two of my files have one-letter filenames : x.txt and y.txt, the page names are respectively X and Y. Although I can see these pages in sitemap, they don't appear in IndexMenu unless I add a second character to their filenames.

Not a big problem for me as I just renamed them xx.txt and yy.txt but I thought you might want to know ^^

-- Pascal

Klap-in commented 7 months ago

I created page x at top level, and test:a and test:b a level deeper, and all of them are listed. In a none js tree and js tree.

I just publish a release with quite some internal changes, maybe I hit the nail already. Could you update to the latest version, and check if this behavior is still there?

barredespace commented 7 months ago

My case is as follows : The two entries are 4 levels deep like in level1:level2:x:x and level1:level2:y:y. With files named respectively x.txt and y.txt. IndexMenu failed to display these entries either in a no js and in a js tree and unfortunately it still fails after the update.

Maybe my case is a little singular in that I don't use IndexMenu to display a tree at all. My start page looks like this :

====== Glossaire ======  
===== A =====  
{{indexmenu>:glossaire:entrees:a#1|tsort}}  
===== B =====  
{{indexmenu>:glossaire:entrees:b#1|tsort}}  
===== C =====  
{{indexmenu>:glossaire:entrees:c#1|tsort}}  
(…)  
===== Z =====  
{{indexmenu>:glossaire:entrees:z#1|tsort}}  

Which gives quite a long page with links lists for each letter. So for the X entry under the glossaire:entrees:x namespace I should see an X link but it's not there unless I rename its file to xx.txt

Sorry for any over-explaining-the-obvious, I'm currently at the beginning of a (hopefully light) covid and not very sure of my intellectual capabilities at the moment…

Klap-in commented 7 months ago

Thanks for more context. I will have a look later.

Klap-in commented 7 months ago

I can now reproduce what is going on. DokuWiki supports different possible startpages/headpages for a namespace. The indexmenu tries default to use all these definitions to find a headpage for each namespace, and can displays that. In the Configuration Manager you can disable the definitions which you are not using.

For example, if you use only *:start as headpage, you might disable :same: and :inside:. Alternative is that you disable the setting hide_headpage. This prevents that a page is not listed twice if recognized as headpage, because the headpage is already linked in the namespace name. I would suggest to tune first the headpage setting, and next, the hide_headpage setting if still needed.

For your case is disabling :inside: in the headpage setting enough.

image

barredespace commented 7 months ago

OK. Thank you. It works : I just disabled :inside: and could rename xx.txt and yy.txt to x.txt and y.txt and both links are now displayed by IndexMenu. I'm not sur I understand why though 🤨 Well, sort of :

a page with the same namespace name and that is inside it

So x being inside x namespace, IndexMenu retrieves the same link twice and hides one. That's why hide_headpage would be an alternative solution… maybe ?

Anyway, thank you for taking the time to search for a solution.

Klap-in commented 7 months ago

So x being inside x namespace, IndexMenu retrieves the same link twice and hides one. That's why hide_headpage would be an alternative solution… maybe ?

Exactly! You are welcome.