when I first stumbled across @texnixe’s
kirby-mobile-detect, I loved it - but sadly, it seemed that the underlying
Mobile-Detect library wasn’t actively developed anymore.
As time went by, I stumbled across Matomo’s (formerly known as Piwik)
DeviceDetector and decided to make a Kirby plugin out of it. This is still an early version and a work in progress, but apart from missing options which I will include in a later release (eg file caching of results, Kirby-style), it’s fully operational.
So check it out, stay tuned and let me know what you think!
Hey again, I just added a list of all available methods & finished version truncation, see below. This should make working with
Attention: Caching & custom YAML parser coming soon!
kirby-device options to suit your needs:
|Defines the browser build or version format according to the semantic versioning specification (allowed values are
patch as well as
|Optionally enables / disables filecache.
These methods are available to meet your device detection requirements:
// Configuration Methods
// General Device Type Methods
isTouchEnabled() // win8 tablets only
// General Client Type Methods
getBot() // array
getClient() // array | optionally string, eg getClient('version'))
getOs() // array | optionally string, eg getOs('version')
// Specific Device Type Methods
// Specific Client Type Methods
Unless stated, all
isSomething() methods return booleans, all
getSomething() methods return strings.
Caching has finally landed and is performed by Doctrine’s caching component. Have fun, of course feedback is welcome as always.
Thanks a lot, I’ll try it !
kirby-device may now be installed through Composer.
Furthermore, piwik/device-detector on branch
master was updated to v3.10.1 (see ‘changelog’).