定制 silverstripe/mobile 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

silverstripe/mobile

最新稳定版本:0.7.0

Composer 安装命令:

composer require silverstripe/mobile

包简介

The mobile module provides detection for mobile devices, and can serve a different SilverStripe theme to them.The module can either use redirection to a separate mobile domain, or serve mobile optimized content under the same URLs.

README 文档

README

Mobile Module

Build Status

Please note: this module is no longer actively maintained.

Overview

The mobile module provides detection for mobile devices, and can serve a different SilverStripe theme to them. The module can either use redirection to a separate mobile domain, or serve mobile optimised content under the same URLs. It includes a default "blackcandymobile" theme to demonstrate the effects.

The codebase relies on server-side device detection based on user agent strings, which is an unreliable way to determine if a device is considered to be "mobile".

The W3C recommends a "One web" approach that uses "Responsive Design" to adapt content, rather than create isolated mobile experiences under their own domain. Most of the work on mobile optimization will be in client-side techniques like JavaScript and CSS (e.g. through media queries).

Responsive design is not covered by this module, and can be achieved with standard SilverStripe functionality.

The module also exposes this state in SilverStripe controllers so custom logic and CSS/JavaScript includes can be adapted to mobile usage.

Maintainer Contact

  • Sean Harvey (Nickname: halkyon, sharvey) <sean (at) silverstripe (dot) com>

  • Will Rossiter (Nickname: wrossiter, willr) <will (at) silverstripe (dot) com>

Requirements

  • SilverStripe 3.1 or newer

Installation

Unpack and copy the mobile folder into your SilverStripe project.

Run "dev/build" in your browser, for example: "http://localhost/silverstripe/dev/build?flush=all"

A new theme called "blackcandymobile" will be created in your themes folder after invoking the database (dev) build. This theme is a good starting point which you can modify to create your own mobile theme.

If the themes folder can't be written to by the web server during dev/build, please manually copy "blackcandymobile" into your themes folder from the mobile folder.

Alternatively, the module contains a "jquerymobile" sample theme which creates a basic navigation interface through jQuery Mobile. To use this theme, copy it to /themes in the same way, and set it in your SiteConfig as described below.

Configuration

  • SS2.4: In the CMS, browse to the "Pages" tab and click the root node of the site tree to access the SiteConfig settings.
  • SS3: In the CMS, browse to the "Settings" tab on the left navigation bar to access the SiteConfig settings.

Once opened, there's a "Mobile" tab which exposes the configuration options of the mobile module.

These options are quite simple. One set of radio buttons controls the behaviour of the mobile site, and there's text input fields to enter which domain you want to act as the mobile, and which is the full site, so that redirection can occur when a user accesses your site on a mobile device.

There's also a dropdown of all themes on the site. The theme chosen here will be the one that mobile users of your site will see.

Please keep in mind that the mobile domain must point to your site before it will work.

Search Engine Optimization

The module follows Google's recommendations by using a 301 HTTP redirection when using the module in "domain redirection" mode. When using the same URLs, but different themes for mobile and non-mobile content, Google will detect this change by using a different user agent, and index accordingly.

Limitations

  • No fine grained mobile browser detection. There is only a way to detect the device in general, e.g. Android or iPhone, but not the browser and features of the device
  • Only tested on Android and iPhone devices. Other devices NOT tested

Future enhancements

  • Search form in the default theme
  • Integrate with subsites module to serve different content for a mobile site
  • Device feature detection e.g. "Does this device support SSL?" or "Does this device support XHTML?" for progressive enhancement
  • Dynamic image insertion and resizing via HTML5 data attributes

silverstripe/mobile 适用场景与选型建议

silverstripe/mobile 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 9.81k 次下载、GitHub Stars 达 35, 最近一次更新时间为 2013 年 01 月 03 日, 在 PHP 生态内属于活跃度较高的组件。

它主要适用于以下技术方向: 「mobile」 「silverstripe」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。

我们在过去多个企业项目中使用过 silverstripe/mobile 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 silverstripe/mobile 我们能提供哪些服务?
定制开发 / 二次开发

基于 silverstripe/mobile 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

  • 总下载量: 9.81k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 35
  • 点击次数: 33
  • 依赖项目数: 2
  • 推荐数: 0

GitHub 信息

  • Stars: 35
  • Watchers: 19
  • Forks: 36
  • 开发语言: PHP

其他信息

  • 授权协议: BSD-3-Clause
  • 更新时间: 2013-01-03