Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
Marina Batet
The best way to implement the multichanneling (regular browser vs. mobile)
April 18, 2011 2:46 AM
Answer

Marina Batet

Rank: New Member

Posts: 24

Join Date: April 18, 2011

Recent Posts

Hi everyone,

First of all, I'm new to deploying / developing in Liferay, so I apologize in advanced for any stupid questions I may ask. And also, I apologize for my poor english emoticon

We are deploying Liferay for the first time in my organization, developing our web. The main problem we are facing right now is in the separation of structure and content when you have two different versions of the web, one for regular browsers and the other for smartphones.

We have defined our basic structure of content (web content), with its basic fields and such, and what we need now is to know how to display differently this content depending if you are viewing it from a regular browser (or tablet) or from a smartphone.

Ideally, we should be able to separate the presentation (and the structure) according to the layout of the client who is viewing the content (not so ideally, we could separate the presentation according to the client user-agent).

But the really important thing here is, at least, to be able to display some fields and not others (and some portlets and no others) according to the client, but at the same time, sharing our content in the server. We can't just select different themes, I'm assuming that the page template should also be different b/c depending on the client accessing the content we want to show one or other structure (with its different portlets and content fields).

We searched in the forums and documentation and didn't find an alternative that we completly liked. We succesfully installed and tested the extension liferay-multi-device-ext, but it only applies to the theme, and, as I said, I guess that we would need to also apply different page templates, and not only a different theme.

According to your experience, what would be the best alternative for the multichanneling?


1. Create two completely different communities and duplicate the content in each one. This is the "solution" we're trying to avoid, since it seems a step backwards from what we already had before migrating to Liferay.

2. Create a single community that manages a single web structure and its contents, and distinguish the client user-agent in the template. Is this possible? I see that I can access the client HttpRequest from Velocity. I guess I could apply to this HttpRequest object some static class developed by me in order to detect the user agent and act accordingly, couldn't I? This solution, though, does not allow us to have different portlets according to the client channel.

3. Create two different communities (one for mobile devices and other regular browser), sharing the content. The problem with this solution is that we must create two separate structures of the web, and while we may share the web content, that web content continues to have a single template, haven't it? That is, if we assume that the structure (pages) of the mobile version and regular version are independent, the issue of displaying one or other portlets according to the client is easily solved, since the portlets are defined at the page and the page is the unit that defines the structure of the web. Therefore, each community will have its own pages (and their own Page Templates). In contrast, Web Content will be common to both communities and this is where we have the problem, b/c for each content we can only have a template (Web Content Template), whatever the browser that views it. The solution will be, again, to use the client user-agent in order to manage two structures within a single template .

4. Some other alternative that we are not considering...?


Someone has an idea about how can we use the client layout and not the user-agent in order to display one structure or the other for each channel? There is some prevision to simplify this in future versions of Liferay?

And by the way, is there any prevision of being able to easily implement some of the most typical javascript libraries for smartphones (jquery mobile or iUI) in future versions?

Any response will be greatly apreciated!!

Best regards,
Marina Batet
RE: The best way to implement the multichanneling (regular browser vs. mobi
April 26, 2011 1:56 AM
Answer

Marina Batet

Rank: New Member

Posts: 24

Join Date: April 18, 2011

Recent Posts

Anyone?
Jorge Ferrer
RE: The best way to implement the multichanneling (regular browser vs. mobi
April 26, 2011 2:59 AM
Answer

Jorge Ferrer

LIFERAY STAFF

Rank: Liferay Legend

Posts: 2757

Join Date: August 31, 2006

Recent Posts

Hi Marina,

The options that you mentioned are pretty much the ones available right now. I also know that many people prefer to use an external product that acts as a proxy and has a database of devices and is able to automatically adapt the site depending on the specific capabilities of each device.

I think the best option will depend on the project and specially on how different would the regular site be from the mobile site. If they are very similar you will want to have a single sitemap (that is a single community) but if they are quite different (which seems to be more and more common) it's better to have separate sitemaps (but still share the content).

If you don't want to use an external product and what Liferay offers out of the box is not enough, you may need to create some extensions to Liferay like Milen's did with his ext plugin.

For the next versions of Liferay we are working on making it easier to use both strategies above. Here is an excerpt from an internal conversation that I've had recently with other core developers about what I think we can do related to this:

Single site strategy
Create a single site that can be customized so that it has differences depending on the device accessing the site. The site administrator should be able to do the following customizations:
  • Configure that certain portlets will only be shown to certain devices
  • Configure that certain pages will only be shown to certain devices
  • Configure different home pages for each device


Multi site strategy
Create one site per targeted device. The following improvements will be made to support this strategy:
  • Allow site administrators to set rules (leveraging the device detection feature) so that when the site is accessed from certain devices they are forwarded to a separate site.
  • Make it easier for site administrators to create new Sites that will be used for specific instances based on the rules above. While the UI will need to be defined in more detail, the idea is that from the pages management UI there will be an option to create a “Mobile site”. The site administrator would be able to choose for which devices will the new site be used.
  • “Device-specific sites” will share the same content repository as the parent (desktop) site.



Also, the device detection capabilities will be greatly improved (including leveraging Milen's contributions) and the device info will be made available to themes and portlets.

I hope that helps.
Marina Batet
RE: The best way to implement the multichanneling (regular browser vs. mobi
April 28, 2011 2:32 AM
Answer

Marina Batet

Rank: New Member

Posts: 24

Join Date: April 18, 2011

Recent Posts

Thanks a lot for the response!! emoticon


Jorge Ferrer:
I also know that many people prefer to use an external product that acts as a proxy and has a database of devices and is able to automatically adapt the site depending on the specific capabilities of each device.


Such as? Could you give an example of those external products you are refering to?

Jorge Ferrer:
... but if they are quite different (which seems to be more and more common) it's better to have separate sitemaps (but still share the content).


That would be my strategy, but how can you share the content between communities? Is this possible? I need to have all my content in the Global scope? (I have read that only the administrators could edit the content in the Global scope, so, I don't really know if this is an option for our requeriments).

If I could have my shared content, my strategy will be:

  • We would have two communities (regular and mobile), each of one with its own structure and portlets
  • We would share the web content within them (if that is possible!)
  • I will do the layout detection via javascript, and if the user it's not in the appropiate community, I will redirect him via javascript
  • In the content template, I will access the request object, and depending on where am I (regular community or mobile community) I will show one or other fields)


Well, at least, this is my only idea right now...

Jorge Ferrer:

Single site strategy
Create a single site that can be customized so that it has differences depending on the device accessing the site. The site administrator should be able to do the following customizations:
  • Configure that certain portlets will only be shown to certain devices
  • Configure that certain pages will only be shown to certain devices
  • Configure different home pages for each device


Multi site strategy
Create one site per targeted device. The following improvements will be made to support this strategy:
  • Allow site administrators to set rules (leveraging the device detection feature) so that when the site is accessed from certain devices they are forwarded to a separate site.
  • Make it easier for site administrators to create new Sites that will be used for specific instances based on the rules above. While the UI will need to be defined in more detail, the idea is that from the pages management UI there will be an option to create a “Mobile site”. The site administrator would be able to choose for which devices will the new site be used.
  • “Device-specific sites” will share the same content repository as the parent (desktop) site.



Well... that's exactly what we need. At least, it's good to know that it will improve!
David García González
RE: The best way to implement the multichanneling (regular browser vs. mobi
June 14, 2012 8:20 AM
Answer

David García González

Rank: Regular Member

Posts: 127

Join Date: July 14, 2009

Recent Posts

Hi Marina, I am thinking about the best solution to offer a mobile version of a site. Could you please share your experience with this work?

What was finally the best strategy?

Thanks!
Linus Sphinx
RE: The best way to implement the multichanneling (regular browser vs. mobi
June 19, 2012 1:53 PM
Answer

Linus Sphinx

Rank: Junior Member

Posts: 84

Join Date: August 12, 2010

Recent Posts

Sounds like a job for XML/XSLT. See http://cocoon.apache.org/
and take a look at http://www.liferay.com/community/forums/-/message_boards/message/8151068