
Instructions for {{Da smw}}
{{da smw}} is a specialised version of {{da}} which makes it possible to strip the dab term from SMW-rich variables in infoboxes or other templates whose goal is to both collect and display data within the same template -- for example, {{Infobox Person}}. In such situations, the normal procedure of using {{da}} fails spectacularly, because SMW itself is creating an unusual kind of link. The standard linked output looks like this:
[[The Eleventh Hour (TV story)|The Eleventh Hour (TV story)]]

For whatever reason, the SMW coders create links in this very redundant way, which means the only solution is to get rid of the second dab term only.

The only recourse is the use of the #sub parser function, with which you can take off a negative number of letters at the end of the string, resulting in
[[The Eleventh Hour (TV story)|The Eleventh Hour

Add a closing pair of brackets — ]] — and you're golden!

This is a very different principle, however, to the one on which {{da}} works. That template uses a #switch parser function to figure out what kind of page it's on -- (TV story), (comic story), etc. -- and then truncates that specific dab term.

This template doesn't use a #switch at all. Instead, it uses a single calculation to figure out the position of the parentheses, and then it eliminates everything from the space before the opening parentheses to the closing parentheses.

Community content is available under CC-BY-SA unless otherwise noted.
https://tardis.fandom.com/wiki/Template:Da_smw
tardis.fandom.com
crawl=CC-MAIN-2021-25
208356
application/http; msgtype=response
sha1:GYVYK3M6CNPMFMSW45YDSCS2FZTQKZ5X
<urn:uuid:36643060-8f2e-4ba2-8174-05dd058f9796>
2021-06-25T05:57:33Z
151.101.0.194
text/html
sha1:RZ7QREB4RZYCDO4PEMG7SIOWVDJW6TH3
<urn:uuid:98fc514c-b459-4782-a1fe-90a9d0ace62f>
https://tardis.fandom.com/wiki/Template:Da_smw
response
<urn:uuid:d43b282f-bcd1-4b2c-a0a9-260e5b9ff658>
isPartOf: CC-MAIN-2021-25
publisher: Common Crawl
description: Wide crawl of the web for June 2021
operator: Common Crawl Admin (info@commoncrawl.org)
hostname: ip-10-67-67-37.ec2.internal
software: Apache Nutch 1.18 (modified, https://github.com/commoncrawl/nutch/)
robots: checked via crawler-commons 1.2-SNAPSHOT (https://github.com/crawler-commons/crawler-commons)
format: WARC File Format 1.1
conformsTo: https://iipc.github.io/warc-specifications/specifications/warc-format/warc-1.1/