For faster navigation, this Iframe is preloading the Wikiwand page for 帮助:自定义首页.

帮助:自定义首页


维基百科使用手册

当前维基软件支持自定义首页。本文会说明如何设置自定义首页。

历史

自定义首页项目源于2009-2010年度首页改版项目,当时有建议维基百科应容让用户自定义首页,议案最终获得通过而软件亦自此引入。

个性化现有首页

现有首页采用大量CSS class,允许用户自定义首页的风格(但结构无法改变-如需改变首页结构,请依照“更换至完全不同风格的首页”执行)。如需个性化首页,请进入您的CSS设置页面,并按照需要加入下列内容:

将首页从二栏式改为一栏式
#mp-2012-column-left, #mp-2012-column-right { width: auto; }
隐藏维基球标志
#mp-2012-banner-logo { display: none; }
隐藏某个项目
#mp-2012-<項目名稱> { display: none; }

当中,请将<项目名称>更换为需要隐藏的项目,各项目的项目名称如下:

  • 左栏:column-left
    • 典范条目:column-feature-block
    • 你知道吗:column-dyk-block
    • 优良条目:column-good-block
    • 每日图片:column-featurepic-block
  • 右栏:column-right
    • 第一个框:column-right-block-a
      • 新闻动态:column-itn-block
      • 历史上的今天:column-otd-block
      • 动态热门:column-uptrends-block
    • 第二个框:column-right-block-b
      • 参与维基百科:column-participate-block
    • 第三个框:column-right-block-c
      • 维基百科提醒您:column-tips-block
  • 站点链接:links
  • 姊妹项目:sisters

例如,如果要隐藏动态热门,请加入:

#mp-2012-column-uptrends-block { display: none; }

此处仅列出较常被设置的更动,其他请阅读首页的原始码,之后自行修改。如果不懂得修改,请到技术客栈寻求协助

更换至完全不同风格的首页

进行以下步骤之前,请确认以下条件经已全部满足:

  • 目前处于登录状态。如果未注册账户,你必须先注册才能使用这项功能。
  • 已启用浏览器JavaScript功能。

确认上述条件全部满足后,请在阁下的common.js加入以下内容。将'Wikipedia:首页'修改为您希望作为首页的页面即可,如'Wikipedia:沙盒',即是将Wikipedia:沙盒作为首页:

/** 啟用自訂首頁/自定义首页 start
* from https://zh.wikipedia.org/wiki/Help:自訂首頁#更換至完全不同風格的首頁 https://w.wiki/rF8
* 更改自 https://zh.wikipedia.org/w/index.php?title=MediaWiki:Gadget-mainpage-customization.js&oldid=53992037
* 改作作者:SunAfterRain
**/
var mainpage_customization = 'Wikipedia:首页';
/** 以下請勿變更 **/
mw.loader.using(['ext.gadget.site-lib', 'mediawiki.Uri']).then(function() {
	var uri = mw.Uri();
	if (mw.config.get('wgIsMainPage') && mw.config.get('wgAction') == 'view' && !uri.query.oldid && !uri.query.diff) {
		$('div#mw-content-text').text(wgULS('正在加载自订首页','正在載入自訂首頁')).show().load(mw.config.get('wgScript'), {
        	action: 'render',
        	title: mainpage_customization
    	});
	} 
});
/** 啟用自訂首頁/自定义首页 end **/

早期已失效方式

进行以下步骤之前,请确认以下条件经已全部满足:

  • 目前处于登录状态。如果未注册账户,你必须先注册才能使用这项功能。
  • 已启用浏览器JavaScript功能。
  • 使用Vector面板

确认上述条件全部满足后,请根据下列指引完成设置:

  1. 按“参数设置”按钮(对话页和监视列表链接之间)
  2. 选取“小工具”(或点此前往
  3. 浏览“首页”章节
  4. 选取“自定义首页(如需使用,请选中此项和下面的一项)”
  5. 选取你喜欢的首页,点选预览按钮可以打开该首页(将在同一分页内开启;如想避免离开参数设置,请打开新分页)
    没有你喜欢的首页?请参考“未有你喜欢的首页”章节
  6. 保存设置(按“保存”)
  7. 按此访问首页。如未能启用,请按下Ctrl+F5强制浏览器刷新缓存。

如需取消设置,清除勾选上述选项即可。

编辑“我的样式”

查看现时首页原始码

如有技术问题,欢迎到互助客栈的技术讨论版块讨论。

未有你喜欢的首页

未有你喜欢的首页?请根据下列步骤设置:

方法一

把自定义首页版本设为“我的样式”,并进入“我的样式”,编辑该页并以模板方式,引用该页面。

例如想将自定义首页设置为Wikipedia:首页/自订首页设计/2010年版本,可以在该页输入((Wikipedia:首页/自订首页设计/2010年版本)),并保存页面。

方法二

只勾选“自定义首页(如需使用,请选中此项和下面的一项)”,并保存参数设置。之后进入您的JS页面,并加入下列内容:(此例以Wikipedia:首页/自定义首页设计/2010年版本作例子,可以改成任意页面名称)

MainPageCustomization.set('Wikipedia:首頁/自訂首頁設計/2010年版本');

并保存页面。

首页设计样本

还在烦如何设计自定义首页?快来Category:自定义首页设计找找看吧!

分享你的作品?在作品加[[Category:自訂首頁設計]]就行了!

参见

{{bottomLinkPreText}} {{bottomLinkText}}
帮助:自定义首页
Listen to this article

This browser is not supported by Wikiwand :(
Wikiwand requires a browser with modern capabilities in order to provide you with the best reading experience.
Please download and use one of the following browsers:

This article was just edited, click to reload
This article has been deleted on Wikipedia (Why?)

Back to homepage

Please click Add in the dialog above
Please click Allow in the top-left corner,
then click Install Now in the dialog
Please click Open in the download dialog,
then click Install
Please click the "Downloads" icon in the Safari toolbar, open the first download in the list,
then click Install
{{::$root.activation.text}}

Install Wikiwand

Install on Chrome Install on Firefox
Don't forget to rate us

Tell your friends about Wikiwand!

Gmail Facebook Twitter Link

Enjoying Wikiwand?

Tell your friends and spread the love:
Share on Gmail Share on Facebook Share on Twitter Share on Buffer

Our magic isn't perfect

You can help our automatic cover photo selection by reporting an unsuitable photo.

This photo is visually disturbing This photo is not a good choice

Thank you for helping!


Your input will affect cover photo selection, along with input from other users.

X

Get ready for Wikiwand 2.0 🎉! the new version arrives on September 1st! Don't want to wait?