这是一个未完成组件,有部分模块存在未修复的问题。
- 存在两种讨论串,一种是单页讨论,这种没有摘要,但是标题有一个返回的链接;另外一种是一般的发帖,这种会有摘要,不知道怎么写切换逻辑比较好
- 如果隐藏页面本身的标题,如何在任何网站上都让假标题(.meta-title)继承真标题(#page-title)的样式?
短而无物,该杀!
(account deleted) 3 Apr 2021, 20:01
本组件试图利用wikidot原生的元素和版式模拟讨论区,不需要任何外部样式,理论上可以兼容任何wikidot站点。
下面几个组成部分有的不是必须的,但是在源代码中必须按顺序放置。请仔细阅读下面说明再复制使用:
(可选)隐藏页面标题,替换成假标题
[[include :area-cn-02:component:forum-posts hide-title=-]]]
(可选)讨论串开头
类似于讨论区的开头“摘要”部分。如果要用,把这一块代码放在下面的整个“帖子结构”前面。预览:点击查看效果
[[include :area-cn-02:component:forum-posts thread-head=-]
|thread-link= 前往原页面的链接URL(也可以写其它网页)
|thread-link-text= URL的文字,(通常是原页面的标题,但是可以随便写)
|thread-title-suffix=/ 讨论区(这个字可以换)
|thread-time= 讨论串发起时间,通常和一楼发帖时间相同(格式是14 Mar 2023, 16:02 这种,日/英文月/年+24小时制的时分)
|post-count= 帖子总楼数
]]
帖子结构
[[include :area-cn-02:component:forum-posts thread-start=-]]]
[[include :area-cn-02:component:forum-posts post-start=-]
|title= 贴文标题
|user= 发帖者的wikidot id
|time= 发帖时间(格式是14 Mar 2023, 16:02 这种,日/英文月/年+24小时制的时分)
]]
贴文内容(适用所有普通wikidot语法)
如果要插入嵌套回复,请在这里插入另外一整个蓝色部分
[[include :area-cn-02:component:forum-posts post-end=-]]]
如果要插入后续平级回复,请在这里插入另外一整个蓝色部分
[[include :area-cn-02:component:forum-posts thread-end=-]]]
start意思是开始,end是结束;thread在这里的意思是讨论串,post的意思是单条贴文。
大概就是这样,举个例子,假设小明是一楼,然后小强回复小明(楼中楼),小红接着回复小强(楼中楼中楼);但是小刚直接开新回复,这样这个帖子的结构就是:
那么要做出这种效果应该怎么用这个组件呢?示例如下:
[[include :area-cn-02:component:forum-posts thread-start=-]]]
[[include :area-cn-02:component:forum-posts post-start=-]
|title= 小明的标题
|user= 小明的id
|time= 小明发帖时间
]]
大家好,我是小明
[[include :area-cn-02:component:forum-posts post-start=-]
|title= 小强的标题
|user= 小强的id
|time= 小强发帖时间
]]
大家好,我是小强
[[include :area-cn-02:component:forum-posts post-start=-]
|title= 小红的标题
|user= 小红的id
|time= 小红发帖时间
]]
大家好,我是小红
[[include :area-cn-02:component:forum-posts post-end=-]]]
[[include :area-cn-02:component:forum-posts post-end=-]]]
[[include :area-cn-02:component:forum-posts post-end=-]]]
[[include :area-cn-02:component:forum-posts post-start=-]
|title= 小刚的标题
|user= 小刚的id
|time= 小刚发帖时间
]]
大家好,我是小刚。这里另起一楼!
[[include :area-cn-02:component:forum-posts post-end=-]]]
[[include :area-cn-02:component:forum-posts thread-end=-]]]
可以看出,在把最外面的两个组件thread-start和thread-end放好之后,你只需要反复复制中间那一段,然后在合适的地方插入就可以了;楼中楼是插在外层回复的内部的最后位置,而平级回复是放在上一层楼的外面。
模拟删号的用户
请将上面的回复开头这一行
[[include :area-cn-02:component:forum-posts post-start=-]
替换成:
[[include :area-cn-02:component:forum-posts post-start-deleted=-]
如果加了讨论串开头,必须在最后加个结尾,否则会炸
[[include :area-cn-02:component:forum-posts thread-end-end=-]]]
页面版本: 29, 最后编辑于: 06 Jul 2025 15:24