Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/colymba/device-aware

SilverStripe Module adding mobile functions and resolution dependent Image manipulation
https://github.com/colymba/device-aware

Last synced: 7 days ago
JSON representation

SilverStripe Module adding mobile functions and resolution dependent Image manipulation

Awesome Lists containing this project

README

        

------------------------------------------------------
Device Aware v0.2 (29 Jan. 2012)
SilverStripe module
by Thierry Francois : colymba.com
------------------------------------------------------

------------------------------------------------------
ABOUT
------------------------------------------------------
This extension was developed for the needs of responsive layouts
where image sizes would vary with the user's screen resolution.

------------------------------------------------------
DETAILS
------------------------------------------------------
Adds mobile functionlaities:
- detection
- template functions
- resolutions 'database'

Device resolution tools
- default device resolution (classic and mobile)
- save current visitor's resolution

Image manipulation
- image resizing depending on device/visitor resolution
- pre-generated images (cache)

All configured through _config.php

------------------------------------------------------
INSTALL
------------------------------------------------------
copy folder in your SS install. Run dev/build/

------------------------------------------------------
CONFIG
------------------------------------------------------
Open _config.php
Add/remove extensions as required
Reset defaults if required
Set cache config

------------------------------------------------------
EXAMPLES
------------------------------------------------------
Template code example with sample usage of templates functions

------------------------------------------------------
<% if isMobile %>

<% control Image %>
<% if Orientation = 2 %>
src="$URL"<% end_control %> alt="$Name" />
<% else %>
src="$URL"<% end_control %> alt="$Name" />
<% end_if %>
<% end_control %>

<% else %>

<% if Image.isLandscape %>

<% if screenWidth1600Plus %>
src="$URL"<% end_control %> alt="$Name" />
<% else %>
src="$URL"<% end_control %> alt="$Name" />
<% end_if %>

<% else %>

<% if screenHeight1000Plus %>
src="$URL"<% end_control %> alt="$Name" />
<% else %>
src="$URL"<% end_control %> alt="$Name" />
<% end_if %>

<% end_if %>

<% end_if %>

------------------------------------------------------
<% if Orientation = 2 %>
src="$URL"<% end_control %> alt="$Name" />
<% else %>
src="$URL"<% end_control %> alt="$Name" />
<% end_if %>