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

No more than 10 categories per article in Wikisource header template #12

Closed
Daniel-Mietchen opened this issue Jul 21, 2014 · 6 comments
Closed
Assignees
Labels

Comments

@notconfusing
Copy link
Member

related wpoa/JATS-to-Mediawiki#21

@Daniel-Mietchen
Copy link
Member Author

No. The problem is that the header template can only handle 10 categories.

@wrought
Copy link
Member

wrought commented Jul 30, 2014

Seems one of the limitations is in the Header template https://en.wikisource.org/w/index.php?title=Template:Header_more_categories&action=edit

<!--
Categories
   -->{{#if:{{#titleparts:{{{categories|}}}|1|1}}|[[Category:{{#titleparts:{{{categories}}}|1|1}}]]}}<!--
   -->{{#if:{{#titleparts:{{{categories|}}}|1|2}}|[[Category:{{#titleparts:{{{categories}}}|1|2}}]]}}<!--
   -->{{#if:{{#titleparts:{{{categories|}}}|1|3}}|[[Category:{{#titleparts:{{{categories}}}|1|3}}]]}}<!--
   -->{{#if:{{#titleparts:{{{categories|}}}|1|4}}|[[Category:{{#titleparts:{{{categories}}}|1|4}}]]}}<!--
   -->{{#if:{{#titleparts:{{{categories|}}}|1|5}}|[[Category:{{#titleparts:{{{categories}}}|1|5}}]]}}<!--
   -->{{#if:{{#titleparts:{{{categories|}}}|1|6}}|[[Category:{{#titleparts:{{{categories}}}|1|6}}]]}}<!--
   -->{{#if:{{#titleparts:{{{categories|}}}|1|7}}|[[Category:{{#titleparts:{{{categories}}}|1|7}}]]}}<!--
   -->{{#if:{{#titleparts:{{{categories|}}}|1|8}}|[[Category:{{#titleparts:{{{categories}}}|1|8}}]]}}<!--
   -->{{#if:{{#titleparts:{{{categories|}}}|1|9}}|[[Category:{{#titleparts:{{{categories}}}|1|9}}]]}}<!--
   -->{{#if:{{#titleparts:{{{categories|}}}|1|10}}|[[Category:{{#titleparts:{{{categories}}}|1|10}}]]}}<!--

<!--

There is a ParserFunction called "#titleparts" being used for indeed up to 10 Categories. There are limitations to this function, including:

Warning: This function does not degrade gracefully if your input exceeds 255 characters. If the inputted string is 256 characters long or more, this function will simply toss the string back at you.
-- https://www.mediawiki.org/wiki/Help:Extension:ParserFunctions#.23titleparts

Ideally, we should implement some sort of loop to process a high number of categories (apparently not too high as there are mediawiki transclusion limits that would prevent an arbitrary loop for fear of Denial-of-Service). However, Wikisource does not have many loop templates implemented (as wikipedia does for instance), so this is a bit of a tough problem. More info to follow

@Daniel-Mietchen
Copy link
Member Author

I think we should stick to these 10 categories in the header template, but we can probably add additional ones outside the header template via the good old [[Category:XYZ]] syntax, either directly or via a separate template.

@Daniel-Mietchen Daniel-Mietchen changed the title No more than 10 categories per article on Wikisource No more than 10 categories per article in Wikisource header template Jul 30, 2014
@wrought
Copy link
Member

wrought commented Jul 31, 2014

Pick the simplest solution even if an incomplete list of categories is displayed.

@wrought
Copy link
Member

wrought commented Oct 21, 2014

@wrought wrought closed this as completed Oct 21, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants