Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Grouping by namespaces to make it compatible with translation #147

Open
techana opened this issue May 21, 2023 · 4 comments
Open

Grouping by namespaces to make it compatible with translation #147

techana opened this issue May 21, 2023 · 4 comments

Comments

@techana
Copy link

techana commented May 21, 2023

This is a good plugin, but it a lacks an essential feature in my opinion! The auto-generated list should have the ability to group or sort pages by their namespaces.

In my wiki, each page has a number of translations. A page shares the same tags with other pages in different languages. When a reader clicks on a tag in one page, the pagelist plugin lists all pages having that tag, but without distinction between their namespaces! It would be better to group the pages using the topmost namespace, i.e.: en, it, de, etc. In case this is too much to ask, then at least add the ability to show namespaces for the listed pages, e.g.: en:nsp1:page1, de:nsp1:page1, etc., and sort them accordingly.

Thank you!

@techana
Copy link
Author

techana commented May 21, 2023

As a temporary fix, I edited the script "helper.php" and added the following to line #488 (for the version at the time of this writing):

// produce output
- $content = '<a href="' . wl($id) ...
+ $content = str_replace(":", " : ", substr($id, 0, strrpos($id, ":") + 1)) . '<a href="' . wl($id) ...

Note that the function str_replace() is not required here. It is only used to add spaces around the colons; as this would make it easier to read namespace paths.

@fiwswe
Copy link
Contributor

fiwswe commented May 21, 2023

No comment on the usefulness or correct implementation of your feature request.

But it would be better to use CSS for formatting. So instead of replacing ':'with ' : ' you could replace it with something like <span class="pathsep">:</span> and then define CSS for e.g. .pathsep {margin-left: .4em;margin-right: .4em;} even better, don't include the : in the replacement at all. Then CSS could be used to show a or a for example:

$content = str_replace(':', '<span class="pathsep"></span>', …
.pathsep {
    margin-left: .4em;
    margin-right: .4em;
}
.pathsep:before {
    content: "▸";
}

@techana
Copy link
Author

techana commented May 21, 2023

Thank you for the suggestion. I'm aware that dokuwiki has the option to use slashes instead of colons for namespaces separation. So, hardcoding the colons in the code is not a good practice.

@Klap-in
Copy link
Member

Klap-in commented Aug 25, 2023

Could you give an example of the syntax you use for creating a list (with the tag plugin?)?
What kind of results do you have? So probably it helps me to describe the page/namespaces structure, or make a screenshot?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants