SlideShare a Scribd company logo
Optimizing Drupal for Mobile Devices Sugree Phatanapherom [email_address] http://sugree.com/ @sugree
Mobile Devices Something small Something slow Something simple Cellphone Handheld
Motivation http://sugree.com/
Size HTML/Text 5.7K JavaScript 24.4K Stylesheet 9.1K CSS Images 5.3K Images 39.5K Total 84.2K
Complexity
SE W810i
Motivation http://m.sugree.com/
Size HTML/Text 4.4K JavaScript 12.1K Images 37.7K Total 54.3K
Complexity
SE W810i
How? Difficulty Level - VERY EASY Behind success Theme Multi-site
CSS is not enough? Complexity Structure CSS
Mobile Theme http://drupal.org/project/mobile
page.tpl.php <!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.0 Transitional//EN&quot; &quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&quot;> <html xmlns=&quot;http://www.w3.org/1999/xhtml&quot; lang=&quot;<?php print $language->language ?>&quot; xml:lang=&quot;<?php print $language->language ?>&quot;> <head> <title><?php print $head_title ?></title> <meta http-equiv=&quot;Content-Style-Type&quot; content=&quot;text/css&quot; /> <?php print $head ?> </head> <body <?php print theme(&quot;onload_attribute&quot;); ?>> <a href=&quot;<?php print url($_GET['q'], array('query' => NULL, 'fragment' => 'nav', 'absolute' => TRUE)); ?>&quot;><?php print t('skip to navigation');?></a> <?php if ($title != &quot;&quot;): ?> <h2 class=&quot;content-title&quot;><?php print $title ?></h2> <?php endif; ?>  <?php if ($help != &quot;&quot;): ?> <p id=&quot;help&quot;><?php print $help ?></p> <?php endif; ?>  <?php if ($messages != &quot;&quot;): ?> <div id=&quot;message&quot;><?php print $messages ?></div> <?php endif; ?> <?php print $content ?> <?php if ($tabs != &quot;&quot;): ?> <?php print $tabs ?> <?php endif; ?> <a name=&quot;nav&quot;></a> <?php print $left . $right; ?>  <?php if ($footer_message) : ?> <?php print $footer;?> <?php endif; ?> <?php print $closure;?> </body> </html>
node.tpl.php <?php if ($page == 0): ?> <h2><a href=&quot;<?php print $node_url ?>&quot;><?php print $title ?></a></h2> <?php endif; ?> <?php print $content ?> <?php if ($signature): ?> <div class=&quot;user-signature clear-block&quot;><?php print $signature ?></div> <?php endif; ?> <?php print $submitted ?> <?php if ($links): ?> <?php print $links ?> <?php endif; ?>
Customization template.php page.tpl.php
template.php <?php function mobile_regions() { return array( 'leaderboard' => t('leaderboard'), 'suckerfish' => t('suckerfish menu'), 'sidebar_left' => t('left sidebar'), 'sidebar_right' => t('right sidebar'), 'sidebar_outside' => t('outside sidebar'), 'content_top_left' => t('content top left'), 'content_top_right' => t('content top right'), 'content_bottom_left' => t('content bottom left'), 'content_bottom_right' => t('content bottom right'), 'header_left' => t('header left'), 'header_center' => t('header center'), 'header_right' => t('header right'), 'banner' => t('banner'), 'user1' => t('user1'), 'user2' => t('user2'), 'user3' => t('user3'), 'user4' => t('user4'), 'user5' => t('user5'), 'user6' => t('user6'), 'user7' => t('user7'), 'user8' => t('user8'), 'user9' => t('user9'), 'user10' => t('user10'), 'user11' => t('user11'), 'user12' => t('user12'), 'user13' => t('user13'), 'user14' => t('user14'), 'user15' => t('user15'), 'footer_left' => t('footer left'), 'footer_center' => t('footer center'), 'footer_right' => t('footer right') ); }
page.tpl.php <!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.0 Transitional//EN&quot; &quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&quot;> <html xmlns=&quot;http://www.w3.org/1999/xhtml&quot; lang=&quot;<?php print $language ?>&quot; xml:lang=&quot;<?php print $language ?>&quot;> <head> <title><?php print $head_title ?></title> <meta http-equiv=&quot;Content-Style-Type&quot; content=&quot;text/css&quot; /> <?php print $head ?> <style type=&quot;text/css&quot;> body { background-color: #000000; color: #DDDDDD; width: 176px; } a { color: #BBBB00; } </style> </head>
page.tpl.php <?php print theme('menu_links', $primary_links) ?> <?php print theme('menu_links', $secondary_links) ?> <?php print $header_left ?> <?php print $header_center ?> <?php print $header_right ?> <?php print $banner ?> <?php print $sidebar_left ?> <?php print $sidebar_right ?> <?php print $sidebar_outside ?> <?php print $sidebar_top_left ?> <?php print $sidebar_top_right ?> <?php print $sidebar_bottom_left ?> <?php print $sidebar_bottom_right ?> <?php print $user1 ?> <?php print $user2 ?> <?php print $user3 ?> <?php print $user4 ?> <?php print $user5 ?> <?php print $user6 ?> <?php print $user7 ?> <?php print $user8 ?> <?php print $user9 ?> <?php print $user10 ?> <?php print $user11 ?> <?php print $user12 ?> <?php print $user13 ?> <?php print $user14 ?> <?php print $user15 ?> <?php print $footer_left ?> <?php print $footer_center ?> <?php print $footer_right ?> <?php print $closure;?> </body> </html>
Multi-site http://sugree.com/ Tapestry http://m.sugree.com/ Mobile
settings.php # $conf = array( #  'site_name' => 'My Drupal site', #  'theme_default' => 'minnelli', #  'anonymous' => 'Visitor', # ); $conf = array( #  'site_name' => 'My Drupal site', 'theme_default' => 'mobile', #  'anonymous' => 'Visitor', ); sites/sugree.com/settings.php sites/m.sugree.com/settings.php
All done? Yes No Automatically redirect if necessary From http://sugree.com/ To http://m.sugree.com/
.htaccess RewriteCond %{HTTP_HOST} !^m\.sugree\.com$ RewriteCond %{HTTP_ACCEPT} &quot;text/vnd.wap.wml|application/vnd.wap.xhtml+xml&quot; [NC,OR] RewriteCond %{HTTP_USER_AGENT} &quot;acs|alav|alca|amoi|audi|aste|avan|benq|bird|blac|blaz|brew|cell|cldc|cmd-&quot; [NC,OR] RewriteCond %{HTTP_USER_AGENT} &quot;dang|doco|eric|hipt|inno|ipaq|java|jigs|kddi|keji|leno|lg-c|lg-d|lg-g|lge-&quot; [NC,OR] RewriteCond %{HTTP_USER_AGENT} &quot;maui|maxo|midp|mits|mmef|mobi|mot-|moto|mwbp|nec-|newt|noki|opwv&quot; [NC,OR] RewriteCond %{HTTP_USER_AGENT} &quot;palm|pana|pant|pdxg|phil|play|pluc|port|prox|qtek|qwap|sage|sams|sany&quot; [NC,OR] RewriteCond %{HTTP_USER_AGENT} &quot;sch-|sec-|send|seri|sgh-|shar|sie-|siem|smal|smar|sony|sph-|symb|t-mo&quot; [NC,OR] RewriteCond %{HTTP_USER_AGENT} &quot;teli|tim-|tsm-|upg1|upsi|vk-v|voda|w3cs|wap-|wapa|wapi&quot; [NC,OR] RewriteCond %{HTTP_USER_AGENT} &quot;wapp|wapr|webc|winw|winw|xda|xda-&quot; [NC,OR] RewriteCond %{HTTP_USER_AGENT} &quot;up.browser|up.link|windowssce|iemobile|mini|mmp&quot; [NC,OR] RewriteCond %{HTTP_USER_AGENT} &quot;symbian|midp|wap|phone|pocket|mobile|pda|psp&quot; [NC] RewriteRule ^(.*)$ http://m.sugree.com/$1 [L,R=302]
Any Questions?

More Related Content

What's hot (20)

DOC
Jogos
lionleoo
 
PPT
Building Secure Twitter Apps
Damon Cortesi
 
ODP
PHP Basics for Designers
Matthew Turland
 
PPT
Block2 Session2 Presentation
Michael Gwyther
 
PPT
Creating Yahoo Mobile Widgets
Ricardo Varela
 
PDF
Secure Coding With Wordpress (BarCamp Orlando 2009)
Mark Jaquith
 
ODP
HTML5: 5 Quick Wins
Jeff Leombruno
 
DOCX
Maritza
ladyva
 
DOCX
Eg2 M1 2009 I
Carlos Albornoz Jiménez
 
PPT
Microformats at Web 2.0 Expo April 2007
John Allsopp
 
PPT
Web APIs & Google APIs
Pamela Fox
 
PDF
A More Perfect Union with CSS
Christopher Schmitt
 
PDF
Lca2009 Video A11y
guesta3d158
 
PDF
2016 First steps with Angular 2 – enterjs
GeilDanke
 
PPT
Living in the Cloud: Hosting Data & Apps Using the Google Infrastructure
Pamela Fox
 
DOCX
MCSL016 IGNOU SOLVED LAB MANUAL
DIVYA SINGH
 
PPT
Html in a box
bdubuque
 
DOCX
Correlatividades febrero 2011
Francisco Quintana
 
PDF
Microformats HTML to API
elliando dias
 
DOC
Yerma
kiarita305
 
Jogos
lionleoo
 
Building Secure Twitter Apps
Damon Cortesi
 
PHP Basics for Designers
Matthew Turland
 
Block2 Session2 Presentation
Michael Gwyther
 
Creating Yahoo Mobile Widgets
Ricardo Varela
 
Secure Coding With Wordpress (BarCamp Orlando 2009)
Mark Jaquith
 
HTML5: 5 Quick Wins
Jeff Leombruno
 
Maritza
ladyva
 
Microformats at Web 2.0 Expo April 2007
John Allsopp
 
Web APIs & Google APIs
Pamela Fox
 
A More Perfect Union with CSS
Christopher Schmitt
 
Lca2009 Video A11y
guesta3d158
 
2016 First steps with Angular 2 – enterjs
GeilDanke
 
Living in the Cloud: Hosting Data & Apps Using the Google Infrastructure
Pamela Fox
 
MCSL016 IGNOU SOLVED LAB MANUAL
DIVYA SINGH
 
Html in a box
bdubuque
 
Correlatividades febrero 2011
Francisco Quintana
 
Microformats HTML to API
elliando dias
 
Yerma
kiarita305
 

Similar to Optimizing Drupal for Mobile Devices (20)

PPT
WordPress Standardized Loop API
Chris Jean
 
ODP
The Basics Of Page Creation
Wildan Maulana
 
ODP
Drupal 7 Theming - what's new
Marek Sotak
 
PDF
User Experience is dead. Long live the user experience!
Greg Bell
 
PDF
Front End on Rails
Justin Halsall
 
PPT
Introduction To Lamp
Amzad Hossain
 
PPTX
Jade & Javascript templating
wearefractal
 
ODP
PHPTAL introduction
'"">
 
PPTX
JQuery 101
The Active Network
 
PPT
Neil Patel - What You Need to be Measuring and How to Do It
Carsonified Team
 
PDF
Building Web Interface On Rails
Wen-Tien Chang
 
PDF
Anvita Dynamic Fontson Web Feb2001
guest6e7a1b1
 
ODP
Mojolicious on Steroids
Tudor Constantin
 
PPT
Enterprise Google Gadgets Integrated with Alfresco - Open Source ECM
Alfresco Software
 
PPT
Developing Gadgets
Quirk
 
PPT
Facebook Development with Zend Framework
Brett Harris
 
PPT
Php Crash Course
mussawir20
 
PPT
ImplementingChangeTrackingAndFlagging
Suite Solutions
 
WordPress Standardized Loop API
Chris Jean
 
The Basics Of Page Creation
Wildan Maulana
 
Drupal 7 Theming - what's new
Marek Sotak
 
User Experience is dead. Long live the user experience!
Greg Bell
 
Front End on Rails
Justin Halsall
 
Introduction To Lamp
Amzad Hossain
 
Jade & Javascript templating
wearefractal
 
PHPTAL introduction
'"">
 
Neil Patel - What You Need to be Measuring and How to Do It
Carsonified Team
 
Building Web Interface On Rails
Wen-Tien Chang
 
Anvita Dynamic Fontson Web Feb2001
guest6e7a1b1
 
Mojolicious on Steroids
Tudor Constantin
 
Enterprise Google Gadgets Integrated with Alfresco - Open Source ECM
Alfresco Software
 
Developing Gadgets
Quirk
 
Facebook Development with Zend Framework
Brett Harris
 
Php Crash Course
mussawir20
 
ImplementingChangeTrackingAndFlagging
Suite Solutions
 
Ad

More from Sugree Phatanapherom (16)

ODP
Twitter, Facebook and etc: Quick Startup Guide for Marketing
Sugree Phatanapherom
 
ODP
@sugree and Twitter
Sugree Phatanapherom
 
ODP
Behind the madness
Sugree Phatanapherom
 
ODP
drupal.in.th
Sugree Phatanapherom
 
ODP
Twitter API and Startup Ideas
Sugree Phatanapherom
 
ODP
Readme Read Sugree
Sugree Phatanapherom
 
ODP
SCMSWeb and Condor-G Demonstration
Sugree Phatanapherom
 
ODP
Hand-on Resources II: Extending SCMSWeb
Sugree Phatanapherom
 
ODP
Drupal: blog and beyond
Sugree Phatanapherom
 
ODP
The Spirit of Open Source
Sugree Phatanapherom
 
ODP
mbpurple - the replacement twitter im
Sugree Phatanapherom
 
ODP
jibjib - ultimate twitter client for your phone
Sugree Phatanapherom
 
ODP
Next Web Application - Brainstorm
Sugree Phatanapherom
 
ODP
Automatic Self-Tuning Architecture for Batch Scheduler on Large Scale Computi...
Sugree Phatanapherom
 
PDF
Call for Students: Google Summer of Code 2008
Sugree Phatanapherom
 
PDF
Twitter Rules
Sugree Phatanapherom
 
Twitter, Facebook and etc: Quick Startup Guide for Marketing
Sugree Phatanapherom
 
@sugree and Twitter
Sugree Phatanapherom
 
Behind the madness
Sugree Phatanapherom
 
drupal.in.th
Sugree Phatanapherom
 
Twitter API and Startup Ideas
Sugree Phatanapherom
 
Readme Read Sugree
Sugree Phatanapherom
 
SCMSWeb and Condor-G Demonstration
Sugree Phatanapherom
 
Hand-on Resources II: Extending SCMSWeb
Sugree Phatanapherom
 
Drupal: blog and beyond
Sugree Phatanapherom
 
The Spirit of Open Source
Sugree Phatanapherom
 
mbpurple - the replacement twitter im
Sugree Phatanapherom
 
jibjib - ultimate twitter client for your phone
Sugree Phatanapherom
 
Next Web Application - Brainstorm
Sugree Phatanapherom
 
Automatic Self-Tuning Architecture for Batch Scheduler on Large Scale Computi...
Sugree Phatanapherom
 
Call for Students: Google Summer of Code 2008
Sugree Phatanapherom
 
Twitter Rules
Sugree Phatanapherom
 
Ad

Recently uploaded (20)

PDF
UiPath DevConnect 2025: Agentic Automation Community User Group Meeting
DianaGray10
 
PDF
NLJUG Speaker academy 2025 - first session
Bert Jan Schrijver
 
PDF
What’s my job again? Slides from Mark Simos talk at 2025 Tampa BSides
Mark Simos
 
PDF
“NPU IP Hardware Shaped Through Software and Use-case Analysis,” a Presentati...
Edge AI and Vision Alliance
 
PPTX
COMPARISON OF RASTER ANALYSIS TOOLS OF QGIS AND ARCGIS
Sharanya Sarkar
 
PPTX
New ThousandEyes Product Innovations: Cisco Live June 2025
ThousandEyes
 
PDF
Bitcoin for Millennials podcast with Bram, Power Laws of Bitcoin
Stephen Perrenod
 
PDF
The Rise of AI and IoT in Mobile App Tech.pdf
IMG Global Infotech
 
PDF
SIZING YOUR AIR CONDITIONER---A PRACTICAL GUIDE.pdf
Muhammad Rizwan Akram
 
PDF
Go Concurrency Real-World Patterns, Pitfalls, and Playground Battles.pdf
Emily Achieng
 
PDF
NASA A Researcher’s Guide to International Space Station : Physical Sciences ...
Dr. PANKAJ DHUSSA
 
PDF
“Squinting Vision Pipelines: Detecting and Correcting Errors in Vision Models...
Edge AI and Vision Alliance
 
PDF
POV_ Why Enterprises Need to Find Value in ZERO.pdf
darshakparmar
 
DOCX
Cryptography Quiz: test your knowledge of this important security concept.
Rajni Bhardwaj Grover
 
PPTX
Agentforce World Tour Toronto '25 - MCP with MuleSoft
Alexandra N. Martinez
 
DOCX
Python coding for beginners !! Start now!#
Rajni Bhardwaj Grover
 
PDF
Newgen Beyond Frankenstein_Build vs Buy_Digital_version.pdf
darshakparmar
 
PDF
Transcript: Book industry state of the nation 2025 - Tech Forum 2025
BookNet Canada
 
PPTX
Future Tech Innovations 2025 – A TechLists Insight
TechLists
 
PPT
Ericsson LTE presentation SEMINAR 2010.ppt
npat3
 
UiPath DevConnect 2025: Agentic Automation Community User Group Meeting
DianaGray10
 
NLJUG Speaker academy 2025 - first session
Bert Jan Schrijver
 
What’s my job again? Slides from Mark Simos talk at 2025 Tampa BSides
Mark Simos
 
“NPU IP Hardware Shaped Through Software and Use-case Analysis,” a Presentati...
Edge AI and Vision Alliance
 
COMPARISON OF RASTER ANALYSIS TOOLS OF QGIS AND ARCGIS
Sharanya Sarkar
 
New ThousandEyes Product Innovations: Cisco Live June 2025
ThousandEyes
 
Bitcoin for Millennials podcast with Bram, Power Laws of Bitcoin
Stephen Perrenod
 
The Rise of AI and IoT in Mobile App Tech.pdf
IMG Global Infotech
 
SIZING YOUR AIR CONDITIONER---A PRACTICAL GUIDE.pdf
Muhammad Rizwan Akram
 
Go Concurrency Real-World Patterns, Pitfalls, and Playground Battles.pdf
Emily Achieng
 
NASA A Researcher’s Guide to International Space Station : Physical Sciences ...
Dr. PANKAJ DHUSSA
 
“Squinting Vision Pipelines: Detecting and Correcting Errors in Vision Models...
Edge AI and Vision Alliance
 
POV_ Why Enterprises Need to Find Value in ZERO.pdf
darshakparmar
 
Cryptography Quiz: test your knowledge of this important security concept.
Rajni Bhardwaj Grover
 
Agentforce World Tour Toronto '25 - MCP with MuleSoft
Alexandra N. Martinez
 
Python coding for beginners !! Start now!#
Rajni Bhardwaj Grover
 
Newgen Beyond Frankenstein_Build vs Buy_Digital_version.pdf
darshakparmar
 
Transcript: Book industry state of the nation 2025 - Tech Forum 2025
BookNet Canada
 
Future Tech Innovations 2025 – A TechLists Insight
TechLists
 
Ericsson LTE presentation SEMINAR 2010.ppt
npat3
 

Optimizing Drupal for Mobile Devices

  • 1. Optimizing Drupal for Mobile Devices Sugree Phatanapherom [email_address] http://sugree.com/ @sugree
  • 2. Mobile Devices Something small Something slow Something simple Cellphone Handheld
  • 4. Size HTML/Text 5.7K JavaScript 24.4K Stylesheet 9.1K CSS Images 5.3K Images 39.5K Total 84.2K
  • 8. Size HTML/Text 4.4K JavaScript 12.1K Images 37.7K Total 54.3K
  • 11. How? Difficulty Level - VERY EASY Behind success Theme Multi-site
  • 12. CSS is not enough? Complexity Structure CSS
  • 14. page.tpl.php <!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.0 Transitional//EN&quot; &quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&quot;> <html xmlns=&quot;http://www.w3.org/1999/xhtml&quot; lang=&quot;<?php print $language->language ?>&quot; xml:lang=&quot;<?php print $language->language ?>&quot;> <head> <title><?php print $head_title ?></title> <meta http-equiv=&quot;Content-Style-Type&quot; content=&quot;text/css&quot; /> <?php print $head ?> </head> <body <?php print theme(&quot;onload_attribute&quot;); ?>> <a href=&quot;<?php print url($_GET['q'], array('query' => NULL, 'fragment' => 'nav', 'absolute' => TRUE)); ?>&quot;><?php print t('skip to navigation');?></a> <?php if ($title != &quot;&quot;): ?> <h2 class=&quot;content-title&quot;><?php print $title ?></h2> <?php endif; ?> <?php if ($help != &quot;&quot;): ?> <p id=&quot;help&quot;><?php print $help ?></p> <?php endif; ?> <?php if ($messages != &quot;&quot;): ?> <div id=&quot;message&quot;><?php print $messages ?></div> <?php endif; ?> <?php print $content ?> <?php if ($tabs != &quot;&quot;): ?> <?php print $tabs ?> <?php endif; ?> <a name=&quot;nav&quot;></a> <?php print $left . $right; ?> <?php if ($footer_message) : ?> <?php print $footer;?> <?php endif; ?> <?php print $closure;?> </body> </html>
  • 15. node.tpl.php <?php if ($page == 0): ?> <h2><a href=&quot;<?php print $node_url ?>&quot;><?php print $title ?></a></h2> <?php endif; ?> <?php print $content ?> <?php if ($signature): ?> <div class=&quot;user-signature clear-block&quot;><?php print $signature ?></div> <?php endif; ?> <?php print $submitted ?> <?php if ($links): ?> <?php print $links ?> <?php endif; ?>
  • 17. template.php <?php function mobile_regions() { return array( 'leaderboard' => t('leaderboard'), 'suckerfish' => t('suckerfish menu'), 'sidebar_left' => t('left sidebar'), 'sidebar_right' => t('right sidebar'), 'sidebar_outside' => t('outside sidebar'), 'content_top_left' => t('content top left'), 'content_top_right' => t('content top right'), 'content_bottom_left' => t('content bottom left'), 'content_bottom_right' => t('content bottom right'), 'header_left' => t('header left'), 'header_center' => t('header center'), 'header_right' => t('header right'), 'banner' => t('banner'), 'user1' => t('user1'), 'user2' => t('user2'), 'user3' => t('user3'), 'user4' => t('user4'), 'user5' => t('user5'), 'user6' => t('user6'), 'user7' => t('user7'), 'user8' => t('user8'), 'user9' => t('user9'), 'user10' => t('user10'), 'user11' => t('user11'), 'user12' => t('user12'), 'user13' => t('user13'), 'user14' => t('user14'), 'user15' => t('user15'), 'footer_left' => t('footer left'), 'footer_center' => t('footer center'), 'footer_right' => t('footer right') ); }
  • 18. page.tpl.php <!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.0 Transitional//EN&quot; &quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&quot;> <html xmlns=&quot;http://www.w3.org/1999/xhtml&quot; lang=&quot;<?php print $language ?>&quot; xml:lang=&quot;<?php print $language ?>&quot;> <head> <title><?php print $head_title ?></title> <meta http-equiv=&quot;Content-Style-Type&quot; content=&quot;text/css&quot; /> <?php print $head ?> <style type=&quot;text/css&quot;> body { background-color: #000000; color: #DDDDDD; width: 176px; } a { color: #BBBB00; } </style> </head>
  • 19. page.tpl.php <?php print theme('menu_links', $primary_links) ?> <?php print theme('menu_links', $secondary_links) ?> <?php print $header_left ?> <?php print $header_center ?> <?php print $header_right ?> <?php print $banner ?> <?php print $sidebar_left ?> <?php print $sidebar_right ?> <?php print $sidebar_outside ?> <?php print $sidebar_top_left ?> <?php print $sidebar_top_right ?> <?php print $sidebar_bottom_left ?> <?php print $sidebar_bottom_right ?> <?php print $user1 ?> <?php print $user2 ?> <?php print $user3 ?> <?php print $user4 ?> <?php print $user5 ?> <?php print $user6 ?> <?php print $user7 ?> <?php print $user8 ?> <?php print $user9 ?> <?php print $user10 ?> <?php print $user11 ?> <?php print $user12 ?> <?php print $user13 ?> <?php print $user14 ?> <?php print $user15 ?> <?php print $footer_left ?> <?php print $footer_center ?> <?php print $footer_right ?> <?php print $closure;?> </body> </html>
  • 20. Multi-site http://sugree.com/ Tapestry http://m.sugree.com/ Mobile
  • 21. settings.php # $conf = array( # 'site_name' => 'My Drupal site', # 'theme_default' => 'minnelli', # 'anonymous' => 'Visitor', # ); $conf = array( # 'site_name' => 'My Drupal site', 'theme_default' => 'mobile', # 'anonymous' => 'Visitor', ); sites/sugree.com/settings.php sites/m.sugree.com/settings.php
  • 22. All done? Yes No Automatically redirect if necessary From http://sugree.com/ To http://m.sugree.com/
  • 23. .htaccess RewriteCond %{HTTP_HOST} !^m\.sugree\.com$ RewriteCond %{HTTP_ACCEPT} &quot;text/vnd.wap.wml|application/vnd.wap.xhtml+xml&quot; [NC,OR] RewriteCond %{HTTP_USER_AGENT} &quot;acs|alav|alca|amoi|audi|aste|avan|benq|bird|blac|blaz|brew|cell|cldc|cmd-&quot; [NC,OR] RewriteCond %{HTTP_USER_AGENT} &quot;dang|doco|eric|hipt|inno|ipaq|java|jigs|kddi|keji|leno|lg-c|lg-d|lg-g|lge-&quot; [NC,OR] RewriteCond %{HTTP_USER_AGENT} &quot;maui|maxo|midp|mits|mmef|mobi|mot-|moto|mwbp|nec-|newt|noki|opwv&quot; [NC,OR] RewriteCond %{HTTP_USER_AGENT} &quot;palm|pana|pant|pdxg|phil|play|pluc|port|prox|qtek|qwap|sage|sams|sany&quot; [NC,OR] RewriteCond %{HTTP_USER_AGENT} &quot;sch-|sec-|send|seri|sgh-|shar|sie-|siem|smal|smar|sony|sph-|symb|t-mo&quot; [NC,OR] RewriteCond %{HTTP_USER_AGENT} &quot;teli|tim-|tsm-|upg1|upsi|vk-v|voda|w3cs|wap-|wapa|wapi&quot; [NC,OR] RewriteCond %{HTTP_USER_AGENT} &quot;wapp|wapr|webc|winw|winw|xda|xda-&quot; [NC,OR] RewriteCond %{HTTP_USER_AGENT} &quot;up.browser|up.link|windowssce|iemobile|mini|mmp&quot; [NC,OR] RewriteCond %{HTTP_USER_AGENT} &quot;symbian|midp|wap|phone|pocket|mobile|pda|psp&quot; [NC] RewriteRule ^(.*)$ http://m.sugree.com/$1 [L,R=302]