확장기능:모바일 프론트엔드
MobileFrontend 출시 상태: 안정 |
|
---|---|
구현 | 사용자 인터페이스, 훅 |
설명 | 모바일 친화적 보기 제공 |
만든 이 | |
최신 버전 | 2.4.1 |
호환성 정책 | 스냅샷은 미디어위키와 함께 릴리스됩니다. Master is not backward compatible. |
MediaWiki | 1.33+[1] |
PHP | 5.5.9+ |
라이선스 | GNU General Public License 2.0 or later |
다운로드 | README |
예제 | m.mediawiki.org |
|
|
|
|
Quarterly downloads | 798 (Ranked 3rd) |
Public wikis using | 9,025 (Ranked 14th) |
MobileFrontend 확장 기능 번역 (translatewiki.net에서 가능한 경우) | |
이슈 | 미해결 작업 · 버그 보고 |
모바일 프론트엔드 확장기능:
This extension is maintained by the Web team. |
Features include:
- 모바일 이용자들을 위한 별도의 모바일 UI를 만듭니다.
- 시스템 관리자는 다른 스킨을 제공 할 수 있습니다. 예. 스킨:미네르바 노이어 .
- 다양한 컨텐츠 변환 기능을 제공하여 컨텐츠를 더욱 친숙하게 만듭니다.
- notably section collapsing and content re-arrangement and removal, including putting the lead paragraph above the lead photo or info box, even if the lead paragraph is below them in the page's source code.
- 모바일 하단바를 간단하게 만들고 데스크톱/모바일 사이트 링크를 만듭니다.
- provides a beta mode with a feature management system for adding experimental features for anonymous users.
This page is designed for end users who want to install it on their development instance. If you are keen to help us build it and improve it we encourage you to get involved.
전제조건
모바일 프론트엔드를 설치하기전, 틀(template) 그리고/또는 inline style(스타일 속성)을 강력하게 사용할수 있게 하기 위해서는 당신의 컨텐트가 모바일에 적합한지 살펴보아야 합니다. The TemplateStyles extension can be used to style content so that it renders nicely on mobile and desktop. MobileFrontend will not magically fix this for you!
In particular, you may want to review your landing page (main page). Mobile Gateway/Mobile homepage formatting|모바일 대문 설정을 참조.
설치
- 파일을 다운로드하고
MobileFrontend
폴더를extensions/
디렉토리에 넣어 주세요.
개발자와 코딩 기여자는 Git을 이용해 확장기능을 다운받는 것이 좋습니다.cd extensions/
git clone https://gerrit.wikimedia.org/r/mediawiki/extensions/MobileFrontend - 아래의 코드를 LocalSettings.php 코드의 마지막에 추가합니다.
wfLoadExtension( 'MobileFrontend' );
- [[#Configuration settings|* 만약 사용자의 편의에 필요한 구성]]
- 완료 – 위키의 ‘Special:Version’에 이동해서, 확장기능이 올바르게 설치된 것을 확인합니다.
Vagrant 설치:
- Vagrant 를 사용하고 있는 경우에는,
vagrant roles enable mobilefrontend --provision
로 설치해주세요
Nearby 셋업
MobileFrontend provides the Special:Nearby page with a little configuration. To get this to work, a few optional steps are required:
- 브라우저 보안상, SSL 보안 사이트를 운영할 필요가 있습니다. - 그것이 사용자에 HTTP위치에 따라 요청이 불가능 할 수도 있습니다.
- GeoData extension 설치하기
- Run update.php
- In
LocalSettings.php
add$wgMFNearby = true;
- Determine article coordinates:
- Add location data to your articles by using the
coordinates
parser function, for example{{#coordinates:37.786971|-122.399677|primary}}
. For syntax details, see the documentation for GeoData . - Alternatively, you can use a separate MediaWiki installation for Nearby by setting
$wgMFNearbyEndpoint
in yourLocalSettings.php
file. For example,$wgMFNearbyEndpoint = 'https://en.m.wikipedia.org/w/api.php';
will use coordinates of English Wikipedia articles. The nearby endpoint will be used to find content related to a given location.
- Add location data to your articles by using the
스킨 설치
MobileFrontend provides you with a mobile formatted website to go alongside your existing desktop website. You can skin it however you want.
// Choose one of these pairs of lines and add chosen code to bottom of LocalSettings.php file:
wfLoadSkin( 'MinervaNeue' );
$wgDefaultMobileSkin = 'minerva'; // use Minerva skin (You need to download and install it separately in 1.37 and older, otherwise you'll get an exception)
wfLoadSkin( 'Vector' );
$wgDefaultMobileSkin = 'vector'; // use Vector skin
wfLoadSkin( 'Timeless' );
$wgDefaultMobileSkin = 'timeless'; // use Timeless skin
The following skins are compatible with MobileFrontend:
- Skin:Minerva Neue (stable, default on WMF wikis)
- Skin:Vector (default desktop skin, uses an experimental responsive mode for mobile)
- Skin:Timeless (experimental skin)
- 스킨:모노북
- Skin:Citizen (responsive skin)
구성 설정
All configuration options are detailed in the README.md file.
Additional tweaks
Get the most out of MobileFrontend by adding these optional compatible extensions:
- Extension:GeoData - Get Special:Nearby and geotag your articles.
- Extension:PageImages - Adds images to search and nearby results.
- Extension:VisualEditor - Add Visual editing to your mobile experience.
로컬 커스터마이징
CSS 설정
미디어위키 버전: | ≤ 1.40 |
To apply CSS to your mobile theme, edit MediaWiki:Mobile.css, the counterpart of MediaWiki:Common.css.
In order for the stylesheet to function you may have to add mw.loader.using('mobile.site.styles')
to your MediaWiki:Mobile.js.
MobileFrontend does not load the global MediaWiki:Common.css, neither does it load any of the user stylesheets.
자세한 정보
If you would like to test the mobile extension on a desktop browser or your device doesn't render the mobile version, you can append the following key-value pair to the URL query string: ?useformat=mobile
. For example: https://en.wikipedia.org/wiki/MediaWiki?useformat=mobile
If you would like to view the mobile version of a page without enabling the extension across the entire site you can append the string to the URL on that page, too.
Legacy features of MobileFrontend
MobileFrontend has traditionally been a very large extension. Many features have either surpassed their requirements or will do at some future date. These are listed below.
API
APIs are provided by the MobileFrontend extension, but long term we expect to deprecate them in favour of Page Content Service. Use these APIs at your own risk. They may disappear (although we will give you sufficient notice when they do)!
MobileView API
This feature was removed completely in version 1.39. |
Extended action=parse
action=parse
accepts extra parameters:
mobileformat=
- Return rendered page HTML in a mobile format 1.23+.
mainpage
- Apply mobile main page transformations.
예시:
Result |
---|
{
"parse": {
"title": "Therion (band)",
"text": {
"*": "<div><table class=\"infobox vcard plainlist\" style=\"width:22em\"><tr><th colspan=\"2\" style=\"text-align:center;font-size:125%;font-weight:bold;background-color: #b0c4de\"><span class=\"fn org\">Therion</span></th>\n</tr><tr><td colspan=\"2\" style=\"text-align:center\"><a href=\"/wiki/File:2130860153_281d30b3bf_b.jpg\" class=\"image\">
...
|
meta=siteinfo
The domain of the mobile version of the site (which might or might not be the same as the normal domain) is available under the mobileserver
key of the general siteinfo information.
For developers/sysadmins
Setup
You may need to run npm install
and install php composer to get the precommit hook to run, depending on what you're doing with the extension.
Testing with articles on a foreign wiki (live data)
모바일 뷰 사용하기
WMF 사이트들
On Wikimedia Foundation-run sites, we use Varnish caching servers to check the user agent of your device.
WMF를 사용하지 않는 사이트들
For non-WMF sites, you can either set up your configuration to mimic how things are done at the WMF (doing device detection at the proxy layer and setting specific X-Device headers), or you can simply use "?useformat=mobile" to switch an article to use the mobile view. See Extension:MobileFrontend/Configuring browser auto-detection.
$wgMFMobileHeader = 'X-WAP';
or modify your cache (Varnish) header setting, as long as they match.Using Apache (.htaccess or httpd.conf)
To set up a mobile domain, add the following rule to .htaccess or http.config
<IfModule mod_headers.c>
<If "req('Host') =~ /^mobile./i">
RequestHeader set X-Subdomain "mobile"
</If>
</IfModule>
In your hosts file (assuming your desktop site is on localhost
):
127.0.0.1 mobile.localhost
In LocalSettings.php
:
wfLoadExtension('MobileFrontend');
$wgMFAutodetectMobileView = true;
$wgMobileUrlCallback = fn( $domain ) => "mobile.$domain";
Now if you navigate to mobile.localhost you should see the mobile site.
FAQ
The following questions frequently appear on our talk page. Please check this list before posting about them on the talk page or use the existing talk topic, if available, to receive clarifications.
Q: 어떻게 미네바 스킨의 메인 메뉴를 커스터마이징하죠?
A: This is tracked in phabricator but you can see Topic:Tiggc18fvd3stmsf has an interim solution.
Q: How do I add HTML to the Minerva skin, for example to add ads or additional script tags?
A: You can do this by editing the template file for the skin (currently include/skins/minerva.mustache
). See this discussion for details.
Q: The extension I am using doesn't seem to work on MobileFrontend. Why?
A: It's likely the extension is old and needs to add compatibility to MobileFrontend. Please contact the developer of the extension and point them to ResourceLoader/Writing a MobileFrontend friendly ResourceLoader module. Please do not post to the talk page, as in this case it would be better to file a bug on Phabricator (you can login using your MediaWiki.org username) for a quicker response.
Q: I upgraded MobileFrontend and now I'm getting a fatal exception!
A: You are probably using incompatible versions of MobileFrontend and MediaWiki. In most cases, we can't help you here. Try upgrading MobileFrontend or MediaWiki to resolve your issue.
Q: After upgrading MediaWiki I'm getting an exception wgMFDefaultSkinClass is not setup correctly.
A: MobileFrontend currently assumes you have the 미네르바 노이어 skin installed. If you don't you'll need to install this or configure your mobile skin per instructions above.
확장기능 개발자를 위한
By default resource modules in extensions will not be loaded in mobile view.
Should a module need to be loaded while in mobile view this guide on writing MobileFrontend friendly modules will be of help.
같이 보기
- 모바일 프론트앤드를 지원하는 모바일 웹 브라우저
- 확장기능:TextExtracts
- Commons:Category:MediaWiki extension MobileFrontend
- Extension:MobileDetect
- Extension:Progressive web application: turn any wiki into a mobile app
각주
- ↑ :Fatal error: Uncaught ExtensionDependencyError: MobileFrontend is not compatible with the current MediaWiki core (version 1.32.2), it requires: >= 1.33.0.
이 확장 기능은 하나 이상의 위키미디어 프로젝트에서 사용 중입니다. 이것은 아마도 이 확장 기능이 안정적이고 트래픽이 많은 웹 사이트에서 사용할 수 있을 만큼 충분히 잘 작동한다는 것을 의미합니다. 설치된 위치를 확인하려면 위키미디어의 CommonSettings.php 및 InitialiseSettings.php 구성 파일에서 이 확장 기능의 이름을 찾습니다. 특정 위키에 설치된 확장 기능의 전체 목록은 위키의 Special:Version 문서에서 볼 수 있습니다. |
This extension is included in the following wiki farms/hosts and/or packages: This is not an authoritative list. Some wiki farms/hosts and/or packages may contain this extension even if they are not listed here. Always check with your wiki farms/hosts or bundle to confirm. |