@Blyngre, The8: Hi, I don't speak Norwegian, so I've to d this in English. I'm pinging you 2 because it seems you 2 work most on the football season pages and Tustervatn 99 doesn't answer my question. Maybe 1 of you 2 can answer it.
The question you can read here: Brukerdiskusjon:Tustervatn 99#Mal:Eredivisie 2019-2020 tabell
Let me add, it doesn't make much sense anyway to create a separate template page if only 1 page is referring to it.
If you answer, please include a "ping" so I know someone answered.
--Sb008 (diskusjon) 22. jun. 2020 kl. 00:55 (CEST)[svar]
- @Sb008:: Interesting knowledge how to use it in other settings from main page. Difficult to generalize for all contributers in all sports at no-wiki, but for standings in leagues we usally use templates in norwegian wikipedia. At least for Norwegian leagues where the standings often are linked in the team articles. A personal opinion is that its also not so much editing on the main page with templates as an advantage. Is your issue by using templates that we use more pages or you want to advice to make it easier? Blyngre (diskusjon) 22. jun. 2020 kl. 12:33 (CEST)[svar]
@Blyngre:
Transcluding a page from the main space (an aticle)
[rediger kilde]
Use: {{:<pagename>}} (See the colon (:) after "{{")
Example: {{:Sondre Brunstad Fet}}
Result: I'm not showing the result here because this page will end up in the same categories as the categories listed in the transcluded page. You can see however how it works by copying {{:Sondre Brunstad Fet}} to any page and press "show preview (Førehansvis)". Do not press "publish changes (Publiser endringar)". It's not that important because you don't want to transclude a full article anyway.
Transcluding a page from the template space (a template)
[rediger kilde]
This is what is done on all the football season pages.
Use: {{<pagename>}} (No colon (:) after "{{")
Example: {{Eliteserien 2020 tabell}}
Result:
At the end of the template page <noinclude> and </noinclude> are used to avoid the page where the template page is transcluded to, will end up in the same categories as well. In the example above (transcluding an article), you can use <noinclude> and </noinclude> in the same way.
Basically there are 2 ways to do so:
- Section transclusion
- Labeled (section) transclusion
On my user page Bruker:Sb008 there're a lot of tables. One is for the Eredivisie and another if for the Bundesliga. Both tables are created using the module Modul:Sports table. This module allows the tables to be given a section name using the parameter "section". for the Eredivisie this is "|section=Eredivisie standings" and for the Bundesliga "|section=Bundesliga standings". I can use these names for sectin transclusion.
Use: {{<pagename>|transcludesection=<>section name}}
Example 1: {{:Bruker:Sb008|transcludesection=Bundesliga standings}}
Result:
Example 2: {{:Bruker:Sb008|transcludesection=Eredivisie standings}}
Result:
As I said, both tables are on the same page. It is possible to put the standings tables of all leagues, or the tables of all seasons in the same league, on the same page. As long as you give them all a different different "section name.
Example: Suppose I put the standings tables (using "Sports table") of all seasons of the Norwegian league on the same page. For the standings table of 2020 I use "|section=Eliteserien 2020 tabell", for the table of 2019 ("|section=Eliteserien 2019 tabell"), for the table of 2018 ("|section=Eliteserien 2018 tabell") etc etc
Now if I use {{:Bruker:Sb008|transcludesection=Eliteserien 2019 tabell}} on the Eliteserien i fotball for menn 2019 page it will only transclude the table of 2019. Likewise, if I use {{:Bruker:Sb008|transcludesection=Eliteserien 2011 tabell}} on the Tippeligaen_2011 page it will only transclude the table of 2011.
This only works if I create tables using the nodule "Sports table" because it allows me to set a section name. It will not work for tables created with created with {{Serietabell start}} ....... {Serietabell| 6 .......}} ........ {{Serietabell slutt}} because you cannot set a section name.
If I cannot use "section transclusion" I can use "Labelled (section) transclusion".
The Bundesliga table is listed below the page section (don't confuse this with named section) "German Tabell" (== German Tabell ==). I can use this section as "label".
General: {{#section-h:<page name>|<page section>}} or {{#lsth:<page name>|<page section>}}
Example 1: {{#section-h:Eliteserien i fotball for menn 2019|Tabell}}
Result
As you can see, there is a disadvantage, it transcludes everything under the page section "German Tabell"
There is a way to avoid this. You can create your own labels. You can create labels by using <section begin=<label> /> and <section end=<label> />
If you look here: UEFA Nations League 2018-2019 divisjon A#Sluttspill you see a page section with a bracket, the result of the semi-finals, 3rd place game and final. I can translude that whole page section (in the same a above) by using {{#section-h:UEFA Nations League 2018-2019 divisjon A|Sluttspill}}
Result:
If you next look the code of that page you will see that the "bracket" is place between <section begin=Bracket /> and <section end=Bracket />, the semi-final games between <section begin=Semifinale /> and <section end=Semifinale />, ........, and the final between <section begin=Finale /> and <section end=Finale />.
If I want to have onlt the results of the semi-finals, I can use {{#section:UEFA Nations League 2018-2019 divisjon A|Semifinale}}.
Instead of #section-h, you use #section (The "-h" means you are using a page section as label, without the "-h" it means you use a label defined with <section begin=<label> /> and <section end=<label> />. "Semifinale" is the name of the label.
Result:
This way you can transclude only the section you labeled instead of a complete section.
As you have seen there're many ways to transclude.
If I now look at Mal:Premier League 2019/20 tabell and look which pages link there ("Lenkjer hit" in the menu on the left), you'll see there's only 1 page that links to this template; Premier League 2019/20.
Why use a separate temple with the table if there's only 1 page linking to it. You might just as well put the table on the [Premier League 2019/20]]. And, if later on, it turns out you want more pages to use this table, if you put a "section" parameter in the table, you can transclude to any page you look.
I converted this template page Mal:Eliteserien 2020 tabell to a format using "sports table". Next I made sure "|section=Eliteserien 2020 tabell" is inside the table. Now I can use "section transclusion" to transclude it to were ever I want.
If I want to see the table on this page, I use {{:Bruker:Sb008|transcludesection=Eliteserien 2020 tabell}} here.
Result:
If you want to see the table also on the Mjøndalen Idrettsforening, you just {{:Bruker:Sb008|transcludesection=Eliteserien 2020 tabell}} on that page wherever you want the table to be.
You can even do a lot more. You can give extra parameters which are used by the module "sports table", like e.g. {{:Bruker:Sb008|transcludesection=Eliteserien 2020 tabell|showteam=MJO}} (It will show only 5, the default, entries from the table with team MJO (Mjøndalen) in the middle.
Result:
Or: {{:Bruker:Sb008|transcludesection=Eliteserien 2020 tabell|showteam=SAN|show_limit=7}} (the same but 7 entries and SAN (Sandefjord) in the middle.
Result:'
All in all, you can leave the table on the season page, and use section transclusion. If there're only a few pages that you want to transclude the table to, it's more effective and you don't need to create a separate template page.
There's al so the module Modul:sports results which allows you to create a results matrix and allows you to use the same "trick".
--Sb008 (diskusjon) 22. jun. 2020 kl. 20:34 (CEST)[svar]