Category Limit Exceeded Using Dynamically Generated Categories in MediaWiki

At first I was not sure that the question of how to do something advanced in MediaWiki belonged here, but after reading the faq and thinking about it, I decided that the wiki markup has the same language as HTML and CSS, and if These questions are welcome here, then hopefully this too! If I am wrong, feel free to mark this question. Update: well, as evidenced by the 3 views received by this question, I believe that, although perhaps within the framework of the Stackoverflow rules, there may not be much knowledge on this subject! I guess I will need to ask this question in official forums (trembling)


Problem

In the wiki that I configure on my MediaWiki, I have a template that displays, among other things, dynamically created categories. This means that the page that invokes the template will be classified based on some variables passed to the template. Dynamically generated categories are located within <includeonly> blocks so that the template page itself does not receive categories.

The problem is that I then translated this page to other pages, which also makes the categories translate, and now on the third page there are all categories of all the pages that it translated.

I want to somehow format the template so that the page that calls the template will use the categories, but any pages that send the calling page will not inherit the categories.

Example

Here is my best shot on an example installation. If this is inadequate, I can provide links to my real-life example.

Template:Food
A page that takes a couple of variables and displays a high-format block that explains nutrition, including category output based on a type variable.

Banana
This page invokes the Template:Food template with several variables, including the type set to "fruit" . As a result, when a user views the Banana page, they get a beautifully formatted page with some basic fruit information. In addition, if a user navigates to the Category:Fruit page, he will display the Banana page.

Banana Nut Bread Recipe
This is the problem page. On this recipe page, the author wants to translate all pages for the ingredients so that each ingredient is listed in its well-formatted block. However, when he translates the Banana page using {{:Banana}} , the Fruit category is passed along with it, and now the Banana Nut Bread Recipe page is listed as the Fruit category, which is incorrect.

+6
mediawiki wiki
source share
2 answers

If I understand correctly, you want to limit the included information (category) only to the inclusion of depth 1. I do not think that this is possible.

Possible solutions:

1- Do not put category information in Template:Food . Just place it right on every page of ingredients or, if you really need to, create Template:Food_category or similar. Then each page can have any number {{Food}} , and the value {{food category}} should be explicitly placed.

+3
source share

The Transclusion metric section extension allows you to tag parts of the original article with tags and jump to these tags. Tags can overlap, so you have very detailed control over what you pulled.

https://www.mediawiki.org/wiki/Extension:Labeled_Section_Transclusion

I would think that with the replacement of the Labeled Section, you can translate both the Type: fruit description and the Banana description into separate conclusion statements on the Banana page, but just drag the description onto the Recipe page.

0
source share

All Articles