Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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
- Host: GitHub
- URL: https://github.com/colymba/device-aware
- Owner: colymba
- Created: 2011-12-04T15:28:53.000Z (almost 13 years ago)
- Default Branch: master
- Last Pushed: 2012-01-29T19:39:49.000Z (almost 13 years ago)
- Last Synced: 2024-04-17T01:51:23.299Z (7 months ago)
- Language: PHP
- Homepage:
- Size: 165 KB
- Stars: 11
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README
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 resolutionImage 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 %>