Jump to content

Extension:Header Footer(頁眉頁脚)

From mediawiki.org
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.
This page is a translated version of the page Extension:Header Footer and the translation is 29% complete.
MediaWiki扩展手册
HeaderFooter
发行状态: 稳定版
实现 MyWiki , 扩展语法
描述 Allows content to be included at the top and bottom of the wiki's page content section
作者 Jean-Lou Dupont, James Montalvo, Douglas Mason, Hallo Welt! GmbH
最新版本 4.0
兼容性政策 对于每个有长期支持的MediaWiki发行版本,扩展内都有对应的分支。
MediaWiki 1.43+
数据库更改
Composer mediawiki/header-footer
  • $egHeaderFooterEnableAsyncHeader
  • $egHeaderFooterEnableAsyncFooter
许可证 GNU General Public License 2.0 or later
下載
前往translatewiki.net翻譯Header Footer扩展

Header Footer扩展可在维基页面内容部分的顶部和底部为每个命名空间和每个页面添加内容。

功能

  • 速度 - 与解析器缓存集成
  • Secure - header and footer articles are located in the NS_MEDIAWIKI namespace
  • Controllable - headers and/or footers can be disabled on pages which are edit protected
  • Customizable - headers and footers are wrapped in ‎<div> elements

安裝

  • 下载文件,并解压HeaderFooter文件夹到extensions/目录中。
    开发者和代码贡献人员应改从Git安装此扩展,输入:
    cd extensions/
    git clone https://gerrit.wikimedia.org/r/mediawiki/extensions/HeaderFooter
    
  • 請新增下列代码到您的LocalSettings.php 文件的底部:
    wfLoadExtension( 'HeaderFooter' );
    
  • Yes 完成 – 請导航至您的wiki上的Special:Version,以验证此扩展已成功安装。

用法

Edit the pages:

  • MediaWiki:Hf-nsheader-namespace name
  • MediaWiki:Hf-nsfooter-namespace name

namespace name must be in the language of the wiki (see $wgLanguageCode )

For the 'main' namespace, just use blank i.e. no string, but with the hyphen:

  • MediaWiki:Hf-nsheader-
  • MediaWiki:Hf-nsfooter-

每页的页眉和页脚

Edit the pages:

  • MediaWiki:Hf-header-page name
  • MediaWiki:Hf-footer-page name

禁用命令

On edit protected pages, one can add:

  • __NOHEADER__ - to suppress the page level header
  • __NOFOOTER__ - to suppress the page level footer
  • __NONSHEADER__ - to suppress the namespace level header
  • __NONSFOOTER__ - to suppress the namespace level footer

CSS

  • Page Level Header: <div class="hf-header">
  • Namespace Level Header: <div class="hf-nsheader">
  • Page Level Footer: <div class="hf-footer">
  • Namespace Level Footer: <div class="hf-nsfooter">

示例

  1. Page MediaWiki:hf-nsheader-Extension would contain the wikitext to be included as header for all pages of the Extension namespace.
    • In this case, to suppress the header of the page Extension:HeaderFooter one should a) edit protect it, and b) add __NONSHEADER__ in it.
  2. Page MediaWiki:hf-footer-Extension:HeaderFooter would contain the wikitext to be included as footer for the page Extension:HeaderFooter.
    • In this case, to suppress the footer of the page Extension:HeaderFooter one should a) edit protect it, and b) add __NOFOOTER__ in it.

参阅

  • Extension:PageNotice provides a way for you to define fixed notice messages for the top or the bottom of a page (by individual page name), or entire namespaces (by namespace number).