Vue combinée Vue Plate Arborescence
Sujets [ Précédent | Suivant ]
toggle
Will Henry
Prevent portlets from being moved even as admin
15 juillet 2013 12:40
Réponse

Will Henry

Rang: New Member

Publications: 15

Date d'inscription: 11 juillet 2012

Publications Récentes

I'm sure this is answered somewhere else, I just couldn't seem to search for the right keywords. I have created a mobile theme and I want to lock the portlets on the page in place. As the admin, when I scroll up and down on the page with my thumb, I sometimes click portlet titles and move the portlets around the page. Is there away to set in my theme, in one of the velocity templates, or elsewhere where portlets cannot be moved?
David H Nebinger
RE: Prevent portlets from being moved even as admin
15 juillet 2013 13:26
Réponse

David H Nebinger

Community Moderator

Rang: Liferay Legend

Publications: 11060

Date d'inscription: 1 septembre 2006

Publications Récentes

No, the portal is designed to be this flexible.

However, portlets embedded in the theme cannot be added, moved, or removed, if you're willing to go down that road...
Sandeep Nair
RE: Prevent portlets from being moved even as admin
15 juillet 2013 13:40
Réponse

Sandeep Nair

Rang: Liferay Legend

Publications: 1721

Date d'inscription: 5 novembre 2008

Publications Récentes

You can have static portlets on page. There is a whole bunch of properties to set the static portlets for various cases(for example static portlets on user pages, organization pages, regular sites, pages with specific friendly URL).

 1#
 2    # Specify static portlets that cannot be moved and will always appear on
 3    # every layout. Static portlets will take precedence over portlets that may
 4    # have been dynamically configured for the layout.
 5    #
 6    # For example, if you want the Hello World portlet to always appear at the
 7    # start of the iteration of the first column for user layouts, set the
 8    # property "layout.static.portlets.start.column-1[user]" to "47". If you
 9    # want the Hello World portlet to always appear at the end of the second
10    # column for user layouts, set the property
11    # "layout.static.portlets.end.column-2[user]" to "47". You can input a
12    # list of comma delimited portlet ids to specify more than one portlet. If
13    # the portlet is instanceable, add the suffix "_INSTANCE_abcd" to the
14    # portlet id, where "abcd" is any random alphanumeric string.
15    #
16    # The static portlets are fetched based on the properties controlled by
17    # custom filters using EasyConf. By default, the available filters are
18    # user, community, and organization.
19    #
20    #layout.static.portlets.start.column-1[user]=3,6
21    #layout.static.portlets.end.column-1[user]=14
22    #layout.static.portlets.start.column-2[user]=71_INSTANCE_abcd,7
23    #layout.static.portlets.end.column-2[user]=34,70
24    #layout.static.portlets.start.column-3[user]=
25    #layout.static.portlets.end.column-3[user]=
26
27    #
28    # It is also possible to set static portlets based on the layout's friendly
29    # URL.
30    #
31    #layout.static.portlets.start.column-1[user][/home]=3,6
32    #layout.static.portlets.end.column-2[regular-site][/home]=14
33
34    #
35    # Set the static portlets for the pages of regular sites.
36    #
37    #layout.static.portlets.start.column-1[regular-site]=
38    #layout.static.portlets.end.column-1[regular-site]=
39    #layout.static.portlets.start.column-2[regular-site]=
40    #layout.static.portlets.end.column-2[regular-site]=
41    #layout.static.portlets.start.column-3[regular-site]=
42    #layout.static.portlets.end.column-3[regular-site]=
43
44    #
45    # Set the static portlets for the pages of organization sites.
46    #
47    #layout.static.portlets.start.column-1[organization]=
48    #layout.static.portlets.end.column-1[organization]=
49    #layout.static.portlets.start.column-2[organization]=
50    #layout.static.portlets.end.column-2[organization]=
51    #layout.static.portlets.start.column-3[organization]=
52    #layout.static.portlets.end.column-3[organization]=
53
54    #
55    # Set the static portlets that will appear for every layout. See
56    # /html/portal/layout/view/portlet.jsp for the logic of when these portlets
57    # will be shown. For example, these portlets will only show for layouts that
58    # can contain portlets and are not in a pop up state.
59    #
60    layout.static.portlets.all=


Regards,
Sandeep
Victor Zorin
RE: Prevent portlets from being moved even as admin
15 juillet 2013 16:25
Réponse

Victor Zorin

Rang: Liferay Legend

Publications: 1178

Date d'inscription: 14 avril 2008

Publications Récentes

You can probably address this requirement by modifying css styles within your look-and-feel theme.

Briefly, what you would need is to disable portlet-topper mouse actions whenever the mobile device is detected, e.g.:

1header.portlet-topper {
2  pointer-events: none;
3}
4
5/* but enable drop-downs for look-and-feel, preferences, etc, if you need them */
6header.portlet-topper > .portlet-topper-toolbar > span {
7  pointer-events: all;
8}


How to detect the mobile device is a different story, '@media handheld' or '@media only screen and (max-device-width:480px) ' may well work on your specific handheld...

Modifying portlet.vm file will provide additional control possibilities as you would be able to style portlet header using data from velocity variables and HTTP session attributes.
Will Henry
RE: Prevent portlets from being moved even as admin
22 juillet 2013 10:51
Réponse

Will Henry

Rang: New Member

Publications: 15

Date d'inscription: 11 juillet 2012

Publications Récentes

Your approach worked exactly as I desired. Thank you!