Basically there are 2 ways to do so:
- Section transclusion
- Labeled (section) transclusion
Section transclusion
rediger
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.
Labelled (section) transclusion
rediger
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