Extension:頁眉頁脚

This page is a translated version of the page Extension:Header Footer and the translation is 100% complete.
MediaWiki扩展手册
HeaderFooter
发行状态: 稳定版
描述
可在维基页面内容部分的顶部和底部加入内容
作者 Jean-Lou Dupont, James Montalvo, Douglas Mason, Hallo Welt! GmbH
最新版本 4.0
兼容性政策 对于每个有长期支持的MediaWiki发行版本,扩展内都有对应的分支。
MediaWiki 1.39+
数据库更改
Composer mediawiki/header-footer
许可协议 GNU通用公眾授權條款2.0或更新版本
下載

  • $egHeaderFooterEnableAsyncHeader
  • $egHeaderFooterEnableAsyncFooter
前往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' );
    
  •   完成 – 在您的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 Manual:$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.

参见

  • PageNotice extension – 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).