K (Schützte „Vorlage:Service“ ([Bearbeiten=Nur Administratoren erlauben] (unbeschränkt) [Verschieben=Nur Administratoren erlauben] (unbeschränkt))) |
|||
(4 dazwischenliegende Versionen desselben Benutzers werden nicht angezeigt) | |||
Zeile 1: | Zeile 1: | ||
− | <!-- Start your template code here. for tipps and tools for template development, please refer to our help-section --><includeonly>{{#if:{{{ | + | <!-- Start your template code here. for tipps and tools for template development, please refer to our help-section --><includeonly><!-- |
+ | this template behaves differenty for pages in ns "Service" than those pages, transcluding them. So start a switch case for namespace ids | ||
+ | 1st start with the things shown on pages transcluding the page with this template (PAGE -> PageWithTemplateServer -> Template:Service) | ||
+ | -->{{#switch: {{NAMESPACENUMBER}} | ||
+ | | 3500 =<!-- this is meta namespace. action here should help finding pages where the migration ns meta -> ns service is not done yet | ||
+ | -->[[Category:Inactive services]]{{ambox|type=speedy|text=Diese Seite ist veraltet. Bitte stellen Sie sicher, dass eine Seite mit gleichem Namen im Namensraum ''Service'' existiert und löschen Sie diese Seite!}} | ||
+ | | 3608 =<!-- this is ns service. | ||
+ | * link this service to (a) portal page(s) via smw property (or put it in a gardening category | ||
+ | -->{{#if:{{{portal|}}}|<!-- | ||
+ | ** we have data for parameter "portal". link it via smw: | ||
+ | -->This service links to service portal page(s): {{#arraymap:{{{portal}}}|,|@@@@|[[shows on service landing page::@@@@]]|,<nowiki> </nowiki>}}<!-- | ||
+ | ** parameter "portal" missing or emtpy | ||
+ | -->|{{errortext|Bitte eine oder mehrere Serviceportalseiten angeben, auf denen Artikel für diesen Service angezeigt werden!}}[[Category:Servicepages with erroneous input]]}}<!-- | ||
+ | * set display name to {{{displayname}}} oif set, to page name otherwise | ||
+ | -->{{#set:has display title={{#if:{{{displayname|}}}|{{{displayname}}}|{{PAGENAME}}}}}}{{DISPLAYTITLE:{{#if:{{{displayname|}}}|{{{displayname}}}|{{PAGENAME}}}}}}<!-- | ||
+ | * and now categorize the service | ||
+ | -->{{#ifeq:{{{active|Nein}}}|Ja|[[Category:Services]]|[[Category:Inactive services]]}} | ||
+ | |<!-- the default, so all other pages | ||
+ | * the serive page will be transcluded by articles. So pass comma separated list to calling article template | ||
+ | -->{{#if:{{{portal|}}}|{{#arraymap:{{{portal}}}|,|@@@@|[[{{unlink string|@@@@}}]]|,}}<!-- | ||
+ | ** no portal parameter, show textual warning | ||
+ | -->|<!-- let template article handle this-->}}<!-- | ||
+ | * if this service is inactive, put articles, including it in a special gardening category | ||
+ | -->{{#ifeq:{{{active|Nein}}}|Ja||[[Category:Articles linking to inactive services]]}}<!-- | ||
+ | end of switch -->}}<!--Last line of your template code--></includeonly><noinclude> | ||
{{documentation}} | {{documentation}} | ||
<!-- Add categories to the /doc subpage, not here! --> | <!-- Add categories to the /doc subpage, not here! --> | ||
</noinclude> | </noinclude> |
Aktuelle Version vom 13. April 2023, 06:57 Uhr
Description[Quelltext bearbeiten]
Links a technical service (PAGENAME) to one or many service landing page(s) (parameter portal). Page will also be categorized in Category:Services or Category:Inactive services, depending on parameter active.
When in another namespace than 3608 (Service), returns the associated service portal pages as comma separated list.
Special: When in 3500 (Meta) sets category Category:Inactive services and displays an error.
Parameters[Quelltext bearbeiten]
Links a technical service (PAGENAME) to a service landing page.
Parameter | Beschreibung | Typ | Status | |
---|---|---|---|---|
Serviceportal | portal | Depicts the service landing page, articles belonging to that technical service are listed on | Seite | erforderlich |
Aktiv | active | Activates or deactivates the service. | Boolesch | optional |
Anzeigename | displayname | Sets the name for this service used in the drop down on article forms. | Zeile | optional |
Usage[Quelltext bearbeiten]
{{service |portal=PAGE |active=Ja }}
See also[Quelltext bearbeiten]
- {{service portal}}
- {{article}}
- {{os}}