Customize Consent Preferences

We use cookies to help you navigate efficiently and perform certain functions. You will find detailed information about all cookies under each consent category below.

The cookies that are categorized as "Necessary" are stored on your browser as they are essential for enabling the basic functionalities of the site. ... 

Always Active

Necessary cookies are required to enable the basic features of this site, such as providing secure log-in or adjusting your consent preferences. These cookies do not store any personally identifiable data.

No cookies to display.

Functional cookies help perform certain functionalities like sharing the content of the website on social media platforms, collecting feedback, and other third-party features.

No cookies to display.

Analytical cookies are used to understand how visitors interact with the website. These cookies help provide information on metrics such as the number of visitors, bounce rate, traffic source, etc.

No cookies to display.

Performance cookies are used to understand and analyze the key performance indexes of the website which helps in delivering a better user experience for the visitors.

No cookies to display.

Advertisement cookies are used to provide visitors with customized advertisements based on the pages you visited previously and to analyze the effectiveness of the ad campaigns.

No cookies to display.

Mobile Tools によるモバイル用テーマ切り換え設定

これまで SwitchThemeというモジュールを使って、モバイル用のテーマの切換を行っていたのですが、端末のタイプの判定に使っていたBrowscapというモジュールが動かなくなったので、別のモジュールを探しました。

Mobile Tools というモジュールがあったので、これを使って Android 等のモバイル端末からのアクセス時にテーマを切り換えるように設定してみました。

Mobile Tools に関するドキュメントはここにあります。

Make your site mobile with Mobile Tools

通常のモジュールと同じようにインストールすれば基本的にはすぐに使えます。

Mobile Tools の設定

・Notification / redirection 画面

モバイル用テーマへの切換方法として、別のモバイル用URLへリダイレクトする方法と、同じURLでテーマを切り換える方法があります。
ここでは、同じURLを使いたいので、Mobile URLとDesktop URL を同じにしています。

Mobile Tools block message options はモバイル、デスクトップそれぞれの画面に別々の表示をするブロックの設定で、ここでは、モバイル画面にはデスクトップテーマへのリンクを、デスクトップ画面にはモバイルテーマへのリンクを表示するようにしています。

・Theme Switching 画面

テーマの切換方法を指定する。ここでは、mobile device のときに切換と設定。あと、デフォルトのモバイル用テーマと各デバイスグループ(iPhone, iPod, iPad, Android, …)ごとにテーマ名を設定。ここでは、すべて nokia_mobile を使用する。

ブロックの設定

Mobile Tools message block というのができているので、これをフッタに設定した。これで、モバイル画面のときはフッタ部に “to PC View” というリンクができてここからPC用のテーマに切り換えることができる。逆も同じで、デスクトップ用テーマのときは、”to Mobile View” というリンクができる。

モバイルテーマの調整

Mobile Tools 導入とは関係ないが、ついでなので実際に Andriod端末で画面を見ながら nokia_mobile のテーマを少しいじったりして、いちおう完成。Google AdSense のモバイル用広告なんぞも入れてみたりした。

PAGE TOP