wikifab / explore
- dev-master
- 1427.x-dev
- 2.13.2
- 2.13.1
- 2.13.0
- 2.12.2
- 2.12.1
- 2.12.0
- 2.11.1
- 2.11.0
- 2.10.0
- 2.9.0
- 2.8.0
- 2.7.0
- 2.6.3
- 2.6.2
- 2.6.1
- 2.6.0
- 2.5.1
- 2.5.0
- 2.4.0
- 2.3.0
- 2.2.2
- 2.2.1
- 2.2.0
- 2.1.4
- 2.1.3
- 2.1.2
- 2.1.1
- 2.1.0
- 2.0.3
- 2.0.2
- 2.0.1
- 2.0.0
- 1.1.0
- 1.0.1-rc1
- 1.0.0
- 0.2.5
- 0.2.4
- 0.2.3
- 0.2.2
- 0.2.1
- 0.2.0
- 0.1.0
- dev-ticket-909
- dev-mikael
- dev-mickael
- dev-ticket-1427
- dev-ticket-422
- dev-julien
- dev-ticket-1408
- dev-ticket-1291
- dev-ticket-1290
- dev-develop
- dev-ticket-1048
- dev-ticket-989
- dev-Add-tools-recycling-categories
This package is auto-updated.
Last update: 2024-09-14 23:58:36 UTC
README
explore 页面
导航到页面 'Spécial:WfExplore' 查看完整的 explore 页面
explore 查询
'exploreQuery' 函数根据语义查询显示教程列表
第一个参数是查询,第二个参数(可选)是显示结果的数目限制。其他命名参数也可以设置
- sort:用于排序的字段
- limit:显示的结果数量
- layout:使用的布局(参见布局配置)
示例:{{#exploreQuery: [[area::Électronique]] | 8}} {{#exploreQuery: [[area::Électronique]] | sort=editdate|limit=8}} {{#exploreQuery: [[area::Électronique]] | sort=editdate|limit=8| layout=event}}
displayExplore 函数
要在页面中显示探索器,插入 displayExplore 函数:{{#displayExplore: params}}
输入框函数
要添加用于通过 Special:WfExplore 搜索页面的输入框:{{#exploreinputbox:}}
不能添加两个参数:第一个参数是按钮文本,第二个是占位符 {{#exploreinputbox:GO| placeholder}}
使用全局变量进行配置
2 个变量可以用来配置筛选参数
$wfexploreCategories = [ $categoriesName => [ CategorisValueName => CategorieValueLabel, ... ], ... ]
$wfexploreCategoriesNames = [ 'Type' => 'int:wfexplore-type' , 'area' => 'int:wfexplore-category', 'Difficulty' => 'int:wfexplore-difficulty', 'Cost' => 'int:wfexplore-cost', 'Complete' => 'Complete', ];
注意:使用前缀 'int' 可以使用翻译键
配置显示结果的布局
可以更改结果的布局,要实现这一点,请设置 LocalSettings.php 中的可用布局:$wgExploreResultsLayouts = [ 'event' => DIR . '/views/layout-event.html' ];
然后,当在页面中调用解析函数时,设置 'layout' 参数:{{#displayExplore: layout=event}}
配置布局的筛选器
当给定布局时,可以定义其他筛选器
$wfexploreCategoriesByLayout = [ 'event' => [ $categoriesName => [ CategorisValueName => CategorieValueLabel, ... ], ... ] ];
Wikifab 群组配置
要为像 wikifab 这样的群组配置 explore,以下是配置:(它为群组设置无筛选器)
$wgExploreResultsLayouts = [ 'group' => DIR . '/extensions/WfextStyle/templates/layout-group-search-result.html' ];
$wfexploreCategoriesByLayout = [ 'group' => [] ];
默认排序顺序
默认排序顺序可以使用 LocalSettings.php 中的 $wfeSortField 变量进行配置。例如,按最后更改日期排序:$wfeSortField = 'Modification date';
使用钩子进行配置
Explore::OnGetFilters 可以使用钩子更改类别,这适用于国际化维基。
在 LocalSettings 中记录钩子,并设置一个函数,例如
$wgHooks['Explore::getFilters'][] = 'onExploreGetFilters'; function onExploreGetFilters(& $filters, $layout) { $filters["Type"] = [ ['Oukou'] = 'Oukoukou', ['Ouka'] = 'Oukaka' ]; return true; }