{"id":7672,"date":"2014-10-15T05:55:30","date_gmt":"2014-10-15T12:55:30","guid":{"rendered":"http:\/\/localhost\/exoblog\/?p=7672"},"modified":"2014-10-15T05:55:30","modified_gmt":"2014-10-15T12:55:30","slug":"make-your-platform-truly-responsive-with-this-great-add-on","status":"publish","type":"post","link":"https:\/\/www.exoplatform.com\/blog\/make-your-platform-truly-responsive-with-this-great-add-on\/","title":{"rendered":"Make your Platform truly responsive with this great add-on"},"content":{"rendered":"<p><a href=\"https:\/\/www.exoplatform.com\/blog\/wp-content\/uploads\/2014\/10\/Responsive_1.jpg\"><img decoding=\"async\" loading=\"lazy\" class=\"aligncenter size-full wp-image-7673\" src=\"https:\/\/www.exoplatform.com\/blog\/wp-content\/uploads\/2014\/10\/Responsive_1.jpg\" alt=\"Responsive_1\" width=\"650\" height=\"220\" \/><\/a><\/p>\n<p>Nowadays, users expect the full web experience on their desktops and phones as well as their tablets.<\/p>\n<p>There are mobile versions of eXo for accessing your site. The design and layout are specifically geared for the small screens of devices such as iPhones and Android smartphones.<\/p>\n<p>However, the mobile version is not the only solution.<\/p>\n<p>Responsive web design is a complementary approach for supporting most devices and screen resolutions. The following add-on is a first step in optimizing the eXo Platform UI and layout depending on the media and the available screen size: <a href=\"https:\/\/community.exoplatform.com\/portal\/intranet\/addon-detail\/exo-responsive-addon\" target=\"_blank\" rel=\"noopener\">eXo Responsive Add-on.<\/a><br \/>\n<!--more--><br \/>\n<a href=\"https:\/\/www.exoplatform.com\/blog\/wp-content\/uploads\/2014\/10\/01-mobile-responsive.jpg\"><img decoding=\"async\" class=\"aligncenter size-full wp-image-7676\" src=\"https:\/\/www.exoplatform.com\/blog\/wp-content\/uploads\/2014\/10\/01-mobile-responsive.jpg\" alt=\"01-mobile-responsive\" width=\"650\" \/><\/a><\/p>\n<h2>Prerequisites<\/h2>\n<p>The add-on requires Platform 4.0.x or 4.1.x.<\/p>\n<h2>Installation<\/h2>\n<p>The Responsive add-on is available from the eXo Add-ons Repository. You can install it using the <a href=\"https:\/\/www.google.com\/url?q=http%3A%2F%2Fdocs.exoplatform.com%2Fpublic%2Findex.jsp%3Ftopic%3D%252FPLF41%252FPLFAdminGuide.AddonsManagement.html&amp;sa=D&amp;sntz=1&amp;usg=AFQjCNHaW5QLy3tSWjhN2YQvYC9W4guhHQ\" target=\"_blank\" rel=\"noopener\">eXo Add-ons Manager<\/a> with one single command line, which downloads and deploys it:<\/p>\n<p><span class=\"navCode\">addon install exo-responsive-addon<\/span><\/p>\n<p>After restarting Tomcat, you will see that your site adapts to devices with a small screen by simply using a smaller browser window. You should see that the responsive layout looks like the screenshot below:<\/p>\n<p><a href=\"https:\/\/www.exoplatform.com\/blog\/wp-content\/uploads\/2014\/10\/02-screen-resize.png\"><img decoding=\"async\" class=\"aligncenter size-medium wp-image-7677\" src=\"https:\/\/www.exoplatform.com\/blog\/wp-content\/uploads\/2014\/10\/02-screen-resize.png\" alt=\"02-screen-resize\" width=\"300\" srcset=\"https:\/\/www.exoplatform.com\/blog\/wp-content\/uploads\/2014\/10\/02-screen-resize.png 421w, https:\/\/www.exoplatform.com\/blog\/wp-content\/uploads\/2014\/10\/02-screen-resize-179x300.png 179w, https:\/\/www.exoplatform.com\/blog\/wp-content\/uploads\/2014\/10\/02-screen-resize-282x473.png 282w, https:\/\/www.exoplatform.com\/blog\/wp-content\/uploads\/2014\/10\/02-screen-resize-196x328.png 196w, https:\/\/www.exoplatform.com\/blog\/wp-content\/uploads\/2014\/10\/02-screen-resize-141x236.png 141w, https:\/\/www.exoplatform.com\/blog\/wp-content\/uploads\/2014\/10\/02-screen-resize-78x131.png 78w, https:\/\/www.exoplatform.com\/blog\/wp-content\/uploads\/2014\/10\/02-screen-resize-54x90.png 54w, https:\/\/www.exoplatform.com\/blog\/wp-content\/uploads\/2014\/10\/02-screen-resize-18x30.png 18w\" sizes=\"(max-width: 421px) 100vw, 421px\" \/><\/a><\/p>\n<h2>Customizing the responsive behavior<\/h2>\n<p>We have tested the responsive portlet mainly with iPads and iPhones, and it only has basic responsive support. If you want to adapt the behavior for additional devices or <a href=\"https:\/\/github.com\/exo-addons\/responsive-addon\" target=\"_blank\" rel=\"noopener\">customize<\/a> the functionality for the whole site or specific pages, you can do so yourself by following the guide below.<\/p>\n<p>The responsive portlet is written with the <a href=\"https:\/\/juzuweb.org\/\" target=\"_blank\" rel=\"noopener\">Juzu<\/a> framework and it is placed in the site layout (configured in <span class=\"navCode\"><a href=\"https:\/\/github.com\/exo-addons\/responsive-addon\/\" target=\"_blank\" rel=\"noopener\">sharedlayout.xml<\/a><\/span>) to add responsive capabilities to the whole site.<\/p>\n<p>Start by downloading the source code from <a href=\"https:\/\/github.com\/exo-addons\/responsive-addon\" target=\"_blank\" rel=\"noopener\">https:\/\/github.com\/exo-addons\/responsive-addon<\/a> and then dig into it.<\/p>\n<p><strong>Adding a Viewport Meta Tag<\/strong><\/p>\n<p>In <span class=\"navCode\">org.exoplatform.addons.portlets.responsive.ResponseFilter.java<\/span>, we have implemented a filter to add two viewport meta tags. They are added in <span class=\"navCode\">&lt;head&gt;<\/span>:<\/p>\n<pre class=\"lang:xhtml decode:true \">&lt;meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=1\"&gt;\n&lt;meta name=\"apple-mobile-web-app-capable\" content=\"yes\"&gt;<\/pre>\n<p><strong>Customizing the responsive CSS<\/strong><\/p>\n<p>We use the LESS framework, which is compiled when you build the project with Maven:<\/p>\n<p><a href=\"https:\/\/www.exoplatform.com\/blog\/wp-content\/uploads\/2014\/10\/03-responsive-css.png\"><img decoding=\"async\" loading=\"lazy\" class=\"aligncenter size-medium wp-image-7678\" src=\"https:\/\/www.exoplatform.com\/blog\/wp-content\/uploads\/2014\/10\/03-responsive-css.png\" alt=\"03-responsive-css\" width=\"292\" height=\"300\" srcset=\"https:\/\/www.exoplatform.com\/blog\/wp-content\/uploads\/2014\/10\/03-responsive-css.png 415w, https:\/\/www.exoplatform.com\/blog\/wp-content\/uploads\/2014\/10\/03-responsive-css-293x300.png 293w, https:\/\/www.exoplatform.com\/blog\/wp-content\/uploads\/2014\/10\/03-responsive-css-50x50.png 50w, https:\/\/www.exoplatform.com\/blog\/wp-content\/uploads\/2014\/10\/03-responsive-css-35x35.png 35w, https:\/\/www.exoplatform.com\/blog\/wp-content\/uploads\/2014\/10\/03-responsive-css-320x328.png 320w, https:\/\/www.exoplatform.com\/blog\/wp-content\/uploads\/2014\/10\/03-responsive-css-230x236.png 230w, https:\/\/www.exoplatform.com\/blog\/wp-content\/uploads\/2014\/10\/03-responsive-css-128x131.png 128w, https:\/\/www.exoplatform.com\/blog\/wp-content\/uploads\/2014\/10\/03-responsive-css-88x90.png 88w, https:\/\/www.exoplatform.com\/blog\/wp-content\/uploads\/2014\/10\/03-responsive-css-29x30.png 29w\" sizes=\"(max-width: 292px) 100vw, 292px\" \/><\/a><\/p>\n<p>We use media queries (<span class=\"navCode\">@media<\/span> with <span class=\"navCode\">max-width<\/span> and <span class=\"navCode\">min-width<\/span>) to render a site for different devices and screen resolutions. These are the supported screen sizes:<\/p>\n<pre class=\"lang:css decode:true \">\/* Large desktop *\/\n@media (min-width: 1200px) { ... }\n \n\/* Portrait tablet to landscape and desktop *\/\n@media (min-width: 768px) and (max-width: 979px) { ... }\n \n\/* Landscape phone to portrait tablet *\/\n@media (max-width: 767px) { ... }\n \n\/* Landscape phones and down *\/\n@media (max-width: 480px) { ... }<\/pre>\n<p>We separated these devices into different LESS files for easier management and all these files will be imported in <span class=\"navCode\">responsive.less<\/span>.<\/p>\n<p>We have added some more elements to <span class=\"navCode\">responsive.js <\/span>that do not exist in the standalone Platform, like this icon: <img decoding=\"async\" class=\"aligncenter size-medium wp-image-7679\" src=\"https:\/\/www.exoplatform.com\/blog\/wp-content\/uploads\/2014\/10\/04-button.png\" alt=\"04-button\" width=\"30\" \/> We control some of the behavior when we resize the web browser using: <span class=\"navCode\">$( window ).resize(function() {&#8230;});<\/span><\/p>\n<p>To install the extension, first you need to build the project. Run this command on top of the project: <span class=\"navCode\">$mvn install<\/span>. This will generate a ZIP file (<span class=\"navCode\">bundle\/target\/responsive.zip<\/span>).<\/p>\n<p>The simplest way to install this extension is to unzip this file then copy the JAR file into <span class=\"navCode\">${PLF_TOMCAT}\/lib<\/span> and the WAR file into <span class=\"navCode\">${PLF_TOMCAT}\/webapps<\/span>.<\/p>\n<p>Start your Tomcat instance using: <span class=\"navCode\">.\/start_eXo.sh<\/span><\/p>\n<p>Note: The current version of the Responsive add-on (1.0.0) will override <span class=\"navCode\"><a href=\"https:\/\/github.com\/exo-addons\/responsive-addon\/\" target=\"_blank\" rel=\"noopener\">sharedlayout.xml<\/a><\/span>; however, with eXo Platform 4.1, the Responsive add-on won&#8217;t need to override this XML file anymore because it will use the new dynamic container feature (read the blog post: <a href=\"https:\/\/www.exoplatform.com\/blog\/2014\/09\/18\/super-easy-guide-inject-portlets-wherever-want\/\">Super easy guide: inject your portlets wherever you want!<\/a>). We will rely on dynamic containers in the next release.<\/p>\n<h2>Going further<\/h2>\n<p>For now, the Responsive add-on only includes basic responsive support. In the future, we\u2019d like to polish it to support the whole site fully with a better user experience.<\/p>\n<p>In parallel, we are also working on a more complete and productized responsive layout feature for eXo Platform. You can follow and participate in the specification here:<\/p>\n<p><a href=\"https:\/\/community.exoplatform.com\/portal\/g\/:spaces:platform_4\/platform_4\/wiki\/Responsive_Layout\" target=\"_blank\" rel=\"noopener\">https:\/\/community.exoplatform.com\/portal\/g\/:spaces:platform_4\/platform_4\/wiki\/Responsive_Layout<\/a><\/p>\n<p>If you have any ideas or suggestions, don\u2019t hesitate to post them on the <a href=\"https:\/\/community.exoplatform.com\/portal\/intranet\/forum\" target=\"_blank\" rel=\"noopener\">Support Forums<\/a>.<\/p>\n<h2>Resources<\/h2>\n<p><a href=\"https:\/\/github.com\/exo-addons\/responsive-addon\" target=\"_blank\" rel=\"noopener\">https:\/\/github.com\/exo-addons\/responsive-addon<\/a><br \/>\n<a href=\"https:\/\/community.exoplatform.com\/add-ons\" class=\"broken_link\" target=\"_blank\" rel=\"noopener\">https:\/\/community.exoplatform.com\/add-ons<\/a><\/p>\n<p><b><a href=\"https:\/\/community.exoplatform.com\/portal\/dw\/\" target=\"_blank\" rel=\"noopener\">Join the eXo tribe<\/a> by registering for the community and get updates, tutorials, support, and access to the Platform and add-on downloads!<\/b><\/p>\n<p><!--begin adv-events--><\/p>\n<div class=\"adv-events\" style=\"background: #476fad; padding: 30px 20px; color: white; border-radius: 3px;\">\n<div class=\"media\">\n<div class=\"pull-right\"><a href=\"#\"><br \/>\n<img decoding=\"async\" loading=\"lazy\" class=\"size-full wp-image-6587 alignright\" src=\"https:\/\/www.exoplatform.com\/blog\/wp-content\/uploads\/2014\/02\/how-to-make-the-most-of-eXo-platform41.png\" alt=\"make-the-most-out-of-eXo-platform4\" width=\"161\" height=\"85\" \/><br \/>\n<\/a><\/div>\n<div class=\"media-body\">\n<h4 class=\"media-heading\">Make the most out of eXo Platform 4<\/h4>\n<p>Register to the next webinar and get a complete overview of what you can do with eXo Platform 4. <strong><a href=\"https:\/\/www.exoplatform.com\/contact-us\/\">Reserve your seat now!<\/a><\/strong><\/p>\n<\/div>\n<\/div>\n<\/div>\n<p><!--end adv-events--><\/p>\n","protected":false},"excerpt":{"rendered":"Nowadays, users expect the full web experience on their desktops and phones as well as their tablets. There are mobile versions of eXo for accessing your site. The design and layout are specifically geared for the small screens of devices such as iPhones and Android smartphones. However, the mobile version is not the only solution. [&hellip;]","protected":false},"author":7,"featured_media":12746,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[699],"tags":[],"lang":"en","translations":{"en":7672},"pll_sync_post":[],"_links":{"self":[{"href":"https:\/\/www.exoplatform.com\/blog\/wp-json\/wp\/v2\/posts\/7672"}],"collection":[{"href":"https:\/\/www.exoplatform.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.exoplatform.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.exoplatform.com\/blog\/wp-json\/wp\/v2\/users\/7"}],"replies":[{"embeddable":true,"href":"https:\/\/www.exoplatform.com\/blog\/wp-json\/wp\/v2\/comments?post=7672"}],"version-history":[{"count":0,"href":"https:\/\/www.exoplatform.com\/blog\/wp-json\/wp\/v2\/posts\/7672\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.exoplatform.com\/blog\/wp-json\/"}],"wp:attachment":[{"href":"https:\/\/www.exoplatform.com\/blog\/wp-json\/wp\/v2\/media?parent=7672"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.exoplatform.com\/blog\/wp-json\/wp\/v2\/categories?post=7672"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.exoplatform.com\/blog\/wp-json\/wp\/v2\/tags?post=7672"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}