简体   繁体   English

如何在类别名称中转义冒号以供DPL使用?

[英]How to escape colons in category names for use by DPL?

I have several categories in a mediawiki which have colons in the name. 我在mediawiki中有几个类别,名称中带有冒号。 With DPL, when I try either 使用DPL,当我尝试

category=Foo:bar category = Foo:bar

or 要么

linksto=Category:Foo:bar linksto =类别:Foo:酒吧

I get no results, even though that category when viewed actually shows several hundred pages. 我没有得到任何结果,即使在查看时该类别实际上显示了数百页。 I presume it is due to the colons in the category name. 我认为这是由于类别名称中的冒号引起的。 Is there some way to escape the colon in a way that makes DPL happy? 是否有某种使DPL高兴的方式来逃避结肠?

The only working solution seems to be to use the categorymatch argument, rather than the category argument, using the % wildcard in place of the colons. 唯一可行的解​​决方案似乎是使用%match参数而不是category参数,而使用%通配符代替冒号。

So instead of 所以代替

|category=Foo:bar | category = Foo:bar

use 采用

|categorymatch=Foo%bar | categorymatch = Foo%bar

You should use colon before the category name, for example: 您应该在类别名称前使用冒号,例如:

[[:Category:foo]]

And this will work!. 这将起作用!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM