mediawiki - Mediawiki template url to anchor in other page
问题描述
I have a template with the following:
[[{{{Target}}}|{{{Name}}}]]
If called with {{tmpl|Target=Hest|Name=X}}
I get a nice link to X as expected, if I call with {{tmpl|Target=Hest#here|Name=X}}
I get "[[Hest#here|X]]", ie the text and no link.
How do I make it work with anchor tagged parameters?
解决方案
你的例子应该有效。
这是如何做到的:
创建一个名为
Template:tmpl
内容的页面:[[{{{Target}}}|{{{Name}}}]]
创建一个名为
Fruits
内容的页面:This page lists important fruits. == Favorites == * Apple * Pear * Orange
编辑另一个页面并添加:
{{tmpl|Target=Fruits|Name=Link to page}} {{tmpl|Target=Fruits#Favorites|Name=Link to page with anchor}}
经验证可以在全新的 MediaWiki 安装上工作。
推荐阅读
- excel - 如何使用范围创建登录表单
- flutter - Flutter 无法更新 gc.properties 的时间戳
- mysql - MySql 查询从日期或到日期是否存在选择数据
- kubernetes - Kubernetes 以负载均衡的方式调度 GPU-pod
- c++ - 如果 make_shared/make_unique 可以抛出 bad_alloc,为什么为它设置一个 try catch 块不是一种常见的做法?
- python - gunicorn ImportError:没有名为flask的模块
- unicode - ChrW 功能的替代方案
- python - 在 python 中使用 selenium webdriver 下载具有 stream-url 的文件是嵌入标签中的 chrome 扩展名
- laravel - 调用模型 [App\Models\Employee] 上的未定义关系 [loanRequest]
- python - Poetry and Pytest-cov with Sonar: how to reconcile the references?