미디어위키 BaseTemplate

(미디어위키 스킨 제작시 참고사항에서 넘어옴)

1 개요[ | ]

미디어위키 BaseTemplate
  • 1.36부터는 이것 대신 SkinMustache 사용이 권장된다.

2 data 목록[ | ]

  • title
  • pagetitle
  • displaytitle
  • thispage
  • titleprefixeddbkey
  • titletext
  • articleid
  • isarticle
  • subtitle
  • undelete
  • catlinks
  • feeds
  • mimetype
  • charset
  • wgScript
  • skinname
  • skinclass
  • skin
  • stylename
  • printable
  • handheld
  • loggedin
  • notspecialpage
  • searchaction
  • searchtitle
  • search
  • stylepath
  • articlepath
  • scriptpath
  • serverurl
  • logopath
  • sitename
  • lang
  • dir
  • rtl
  • capitalizeallnouns
  • showjumplinks
  • username
  • userpage
  • userpageurl
  • userlang
  • userlangattributes
  • specialpageattributes
  • prebodyhtml
  • newtalk
  • logo
  • copyright
  • viewcount
  • lastmod
  • credits
  • numberofwatchingusers
  • copyrightico
  • poweredbyico
  • disclaimer
  • privacy
  • about
  • footerlinks
  • footericons
  • indicators
  • sitenotice
  • printfooter
  • bodytext
  • language_urls
  • personal_urls
  • content_navigation
  • content_actions
  • sidebar
  • nav_urls
  • bottomscripts
  • headelement
  • debug
  • debughtml
  • reporttime
  • bodycontent
  • dataAfterContent

3 data 매핑[ | ]

영어 key 한국어 text(별칭) 표시조건(권한) nav_urls sidebar content_actions content_navigation personal_urls vector 스킨 zeta 스킨
둘러보기 TOOLBOX namespaces views actions
mainpage 대문 - O - - - - - - - 사이드바 -
recentchanges 최근 바뀜(바뀐글) - - - - - - - - - 사이드바 navbar
upload 파일 올리기(업로드) - - O - - - - - 사이드바(도구) 햄버거
specialpages 특수 문서 목록 - O - O - - - - - 사이드바(도구) 햄버거
print 인쇄용 판(인쇄) - O - O - - - - - 사이드바(인쇄/내보내기) -
permalink 고유 링크 - O - O - - - - - 사이드바(도구) -
info 문서 정보 - O - O - - - - - 사이드바(도구) 페이지 탭(더 보기)
whatlinkshere 여기를 가리키는 문서(역링크) - O - O - - - - - 사이드바(도구) 페이지 탭
recentchangeslinked 가리키는 글의 최근 바뀜 - O O O - - - - - 사이드바(도구) -
contributions 사용자 기여 로그인 - - - - - - - 사이드바(도구) -
log 기록 목록 로그인 - - - - - - - 사이드바(도구) -
blockip 사용자 차단 관리자 - - - - - - - 사이드바(도구) -
mute 알림 미표시 환경 설정 로그인 - - - - - - - 사이드바(도구) -
emailuser 이 사용자에게 이메일 보내기 로그인 - - - - - - - 사이드바(도구) -
userrights 사용자 그룹 변경 관리자 - - - - - - - 사이드바(도구) -
randompage 임의의 문서로(랜덤) - - O - - - - - - 사이드바 navbar
citethispage 이 문서 인용하기(인용) - - - O - - - - - 사이드바(도구) -
userpage* 사용자 문서* 로그인 - - - - - - - O 사용자 링크 햄버거
anonuserpage 로그인 하지 않음 비로그인 - - - - - - - O 사용자 링크 햄버거
mytalk 사용자토론(토론) 로그인 - - - - - - - O 사용자 링크 햄버거
anontalk 사용자토론(토론) 비로그인 - - - - - - - O 사용자 링크 햄버거
preferences 환경 설정 로그인 - - - - - - - O 사용자 링크 햄버거
watchlist 주시문서 목록 로그인 - - - - - - - O 사용자 링크 햄버거
mycontris 기여 로그인 - - - - - - - O 사용자 링크 햄버거
anoncontribs 기여 비로그인 - - - - - - - O 사용자 링크 햄버거
createaccount 계정 만들기(계정 생성) 비로그인 - - - - - - - O 사용자 링크 햄버거
logout 로그아웃 로그인 - - - - - - - O 사용자 링크 햄버거
login 로그인 비로그인 - - - - - - - O 사용자 링크 햄버거
main* 문서* - - - - O O - - - 페이지 탭 -
talk 토론 - - - - O O - - - 페이지 탭 페이지 탭
read/view 읽기/보기 - - - - O - O - - 페이지 탭 페이지 탭
edit/viewsource 편집/원본 보기 - - - - O - O - - 페이지 탭 페이지 탭
history 역사 보기(역사) - - - - O - O - - 페이지 탭 페이지 탭(더 보기)
watch/unwatch 주시(☆)/주시해제(★) 로그인 - - - O - - O - 페이지 탭 페이지 탭
delete 삭제 관리자 - - - O - - O - 페이지 탭(더 보기) 페이지 탭(더 보기)
move 이동 로그인 - - - O - - O - 페이지 탭(더 보기) 페이지 탭(더 보기)
protect/unprotect 보호/보호 설정 바꾸기 관리자 - - - O - - O - 페이지 탭(더 보기) 페이지 탭(더 보기)

4 간단한 사용 예시[ | ]

<?php
class FooBarTemplate extends BaseTemplate {
	public function execute() {
		$this->html( 'headelement' );

<?php if ( $this->data['newtalk'] ): ?>
	<div class="usermessage"><?php $this->html( 'newtalk' );?></div>
<?php endif ?>

<?php if ( $this->data['sitenotice'] ): ?>
	<div id="siteNotice"><?php $this->html( 'sitenotice' ); ?></div>
<?php endif ?>

<a href="<?= htmlspecialchars( $this->data['nav_urls']['mainpage']['href'] ) ?>" <?= Xml::expandAttributes( Linker::tooltipAndAccesskeyAttribs( 'p-logo' ) ) ?>>
	<img src="<?= $this->text( 'logopath' ) ?>" alt="<?php $this->text( 'sitename' ) ?>">
</a>

<?php if ( $this->data['title'] != '' ): ?>
	<h1 id="firstHeading" class="firstHeading"><?php $this->html( 'title' ); ?></h1>
<?php endif ?>

<?php if ( $this->data['isarticle'] ): ?>
	<div id="siteSub"><?php $this->msg( 'tagline' ); ?></div>
<?php endif ?>

<?php if ( $this->data['subtitle'] ): ?>
	<div id="contentSub"><?php $this->html( 'subtitle' ); ?></div>
<?php endif ?>
<?php if ( $this->data['undelete'] ): ?>
	<div id="contentSub2"><?php $this->html( 'undelete' ); ?></div>
<?php endif ?>

<?php $this->html( 'bodytext' ); ?>

<?php $this->html( 'catlinks' ); ?>

<?php echo $this->getIndicators(); ?>

<?php $this->html( 'dataAfterContent' ); ?>

<!-- Personal tools -->
<ul>
<?php foreach ( $this->getPersonalTools() as $key => $item ): ?>
	<?= $this->makeListItem( $key, $item ) ?>
<?php endforeach ?>
</ul>

<!-- Content Navigation -->
<?php foreach ( $this->data['content_navigation'] as $group => $tabs ): ?>
	<ul>
	<?php foreach ( $tabs as $key => $tab ): ?>
		<?= $this->makeListItem( $key, $tab ) ?>
	<?php endforeach; ?>
	</ul>
<?php endforeach ?>

<!-- Content actions -->
<ul>
<?php foreach ( $this->data['content_actions'] as $key => $tab ): ?>
	<?= $this->makeListItem( $key, $tab ) ?>
<?php endforeach ?>
</ul>

<!-- Toolbox -->
<ul>
<?php foreach ( $this->getToolbox() as $key => $tbitem ): ?>
	<?= $this->makeListItem( $key, $tbitem ) ?>
<?php endforeach; ?>
<?php wfRunHooks( 'SkinTemplateToolboxEnd', array( &$this ) ); ?>
</ul>

<!-- Footer -->
<?php foreach ( $this->getFooterLinks() as $category => $links ): ?>
	<ul>
	<?php foreach ( $links as $key ): ?>
		<li><?php $this->html( $key ) ?></li>
	<?php endforeach ?>
	</ul>
<?php endforeach ?>

<?php $this->printTrail(); ?>
</body></html><?php
	}
}

5 같이 보기[ | ]

6 참고[ | ]

문서 댓글 ({{ doc_comments.length }})
{{ comment.name }} {{ comment.created | snstime }}