For faster navigation, this Iframe is preloading the Wikiwand page for Help:自訂首頁.

Help:自訂首頁


维基百科使用手册

當前維基軟件支持自訂首頁。本文会說明如何設定自訂首頁。

歷史

自訂首頁計劃源於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}}
Help:自訂首頁
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?