Coder Social home page Coder Social logo

justb3a / processwire-mobiledetect Goto Github PK

View Code? Open in Web Editor NEW
2.0 3.0 2.0 199 KB

Mobile Detect uses a lightweight PHP class for detecting mobile devices (including tablets).

Home Page: http://modules.processwire.com/modules/mobile-detect/

License: MIT License

processwire-mobiledetect's Introduction

WARNING: This repository is no longer maintained โš ๏ธ

This repository will not be updated. The repository will be kept available in read-only mode.

ProcessWire Mobile Detect

Overview:

Mobile Detect uses a lightweight PHP class (Mobile_Detect) for detecting mobile devices (including tablets).

Designed for use with ProcessWire 2.4/2.5 http://processwire.com

Installation:

  1. Clone the module and place MobileDetect in your site/modules/ directory.
git clone https://github.com/justonestep/processwire-mobiledetect.git your/path/site/modules/MobileDetect
  1. Login to ProcessWire admin and click Modules.
  2. Click "Check for new modules".
  3. Click "install" next to the new SimpleContactForm module.

Usage:

This Module extends $config and sets the following parameters:

$config->mobileDetect = array(
  'deviceType' => 'deviceType (phone, tablet or desktop)',
  'browser' => 'mobile browser',
  'operatingsystem' => 'mobile operatingsystem',
  'device' => 'mobile device'
);

You can access them where ever you want.
See the example below:

  <body class="devicetype--<?php echo $config->mobileDetect->deviceType?>">
  <body class="devicetype--{{config.mobileDetect.deviceType}}"> // twig

Results in:

<body class="devicetype--phone"> OR
<body class="devicetype--tablet"> OR
<body class="devicetype--desktop">

processwire-mobiledetect's People

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar

processwire-mobiledetect's Issues

Installing Mobile Detect

Reference:

https://processwire.com/talk/topic/9352-fallen-at-the-first-hurdle/page-2#entry90179

Normally, ProcessWire modules are installed in one of three ways:

(1) Create a directory in the /site/modules directory with the name of your module (using CamelCase format). Then copy the files in the directory. Go to the Modules Tab and click Refresh.
(2) Use the third-party ModulesManager by Soma to install the module.
(3) Go to Modules Tab on the Admin Menu, go to Install and click +Add New. Then you have a choice of Add Module From Directory, Add Module From URL or ADD Module From Upload.

This module cannot be installed these ways, due to the fact that there is a mandatory requirement to run the git init and update commands on a submodule.

How any module operates or installs is totally up to the module author. I only ask that you make it very clear and explicit that knowledge of git, to include how to run git commands is a prerequisite for the use of this module. I believe this will not be readily apparent to anyone who is not familiar or knowledgeable about Git.

I do commend you because you have already made changes to explain about the error that someone will receive if those git commands are not run.

Finally, It would be even better if this module installed using the normal methods.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.