Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
Default Edit Controls to invisible Monte Glenn Gardner April 29, 2009 5:17 PM
RE: Default Edit Controls to invisible Jeffrey Handa April 29, 2009 5:20 PM
RE: Default Edit Controls to invisible Monte Glenn Gardner May 4, 2009 12:40 PM
RE: Default Edit Controls to invisible Jeffrey Handa May 4, 2009 6:44 PM
RE: Default Edit Controls to invisible Paul Brennan August 18, 2009 8:03 AM
RE: Default Edit Controls to invisible Florent Teuber June 10, 2009 7:23 AM
RE: Default Edit Controls to invisible Monte Glenn Gardner May 4, 2009 12:41 PM
RE: Default Edit Controls to invisible Jeffrey Handa May 4, 2009 8:36 PM
RE: Default Edit Controls to invisible Monte Glenn Gardner May 4, 2009 1:14 PM
RE: Default Edit Controls to invisible Jeffrey Handa May 4, 2009 8:43 PM
RE: Default Edit Controls to invisible Secret Developer September 11, 2009 10:02 AM
RE: Default Edit Controls to invisible Dhrutika Vyas September 23, 2009 12:12 PM
RE: Default Edit Controls to invisible Secret Developer September 23, 2009 6:47 PM
RE: Default Edit Controls to invisible Dhrutika Vyas September 23, 2009 9:53 PM
RE: Default Edit Controls to invisible Victor Zorin September 23, 2009 10:23 PM
RE: Default Edit Controls to invisible Secret Developer September 24, 2009 5:46 AM
RE: Default Edit Controls to invisible Victor Zorin September 24, 2009 2:55 PM
RE: Default Edit Controls to invisible Secret Developer September 24, 2009 8:59 PM
RE: Default Edit Controls to invisible Victor Zorin September 24, 2009 11:24 PM
RE: Default Edit Controls to invisible Secret Developer September 25, 2009 5:55 AM
RE: Default Edit Controls to invisible Gonzalo Jimenez October 22, 2009 7:18 AM
RE: Default Edit Controls to invisible John Croft March 5, 2010 9:42 AM
RE: Default Edit Controls to invisible atul patel September 25, 2009 5:54 AM
RE: Default Edit Controls to invisible Debasis Padhi July 22, 2013 5:02 AM
RE: Default Edit Controls to invisible Saroj Nayak July 22, 2013 6:29 AM
RE: Default Edit Controls to invisible Debasis Padhi July 22, 2013 6:33 AM
Monte Glenn Gardner
Default Edit Controls to invisible
April 29, 2009 5:17 PM
Answer

Monte Glenn Gardner

Rank: Junior Member

Posts: 37

Join Date: July 11, 2008

Recent Posts

My boss has asked that I modify our them so that the edit controls are toggled off by default.
Here's what I think I know so far:
-When you click the 'toggle edit controls' checkbox in the dock, it calls an AJAX routine which notifies the server that you want to toggle the edit controls.
- The on/off state is stored within session scope, tied to the string key "liferay_toggle_controls"
- When each page is loaded, the server side checks the session variable and then writes out some javascript to store the on/off state in the javascript variable Liferay._editControlsState
- It then calls the function Liferay.util.toggleControls() to add a class "controls-hidden" or "controls-visible" to the <body> tag.
- The base CSS then makes controls hidden if the hidden class is set.

How could I modify the theme so that the default settting, when you first start the session, is that the controls are hidden?
Jeffrey Handa
RE: Default Edit Controls to invisible
April 29, 2009 5:20 PM
Answer

Jeffrey Handa

LIFERAY STAFF

Rank: Expert

Posts: 423

Join Date: December 1, 2008

Recent Posts

Hi Monte,

You will need to add the following line of code to your theme’s init_custom.vm file. If this file doesn’t already exist, you can create it and save it to the docroot\_diffs\templates directory.

#set ($liferay_toggle_controls = $sessionClicks.get($request, "liferay_toggle_controls", "invisible"))
Monte Glenn Gardner
RE: Default Edit Controls to invisible
May 4, 2009 12:40 PM
Answer

Monte Glenn Gardner

Rank: Junior Member

Posts: 37

Join Date: July 11, 2008

Recent Posts

I tried that solution and it didn't work . The controls still default to visible, even after clearing cookies and logging out and then back in again. I modified the custum_init code to this:
#set ($liferay_toggle_controls = $sessionClicks.get($request, "liferay_toggle_controls", null))

and then printed out the $liferay_toggle_controls variable later in the theme. It still evaluated to visible. So, the defaulting to visible seems to occuring somewhere deeper in the system.
Monte Glenn Gardner
RE: Default Edit Controls to invisible
May 4, 2009 12:41 PM
Answer

Monte Glenn Gardner

Rank: Junior Member

Posts: 37

Join Date: July 11, 2008

Recent Posts

(this is for liferay 5.1.1 and 5.1.2
Monte Glenn Gardner
RE: Default Edit Controls to invisible
May 4, 2009 1:14 PM
Answer

Monte Glenn Gardner

Rank: Junior Member

Posts: 37

Join Date: July 11, 2008

Recent Posts

What is the relationship of init.vm to init_custom.vm. If I have a theme with no init.vm in its templates folder, does the system execute an init.vm from some other location before executing my init_custom.vm?
Jeffrey Handa
RE: Default Edit Controls to invisible
May 4, 2009 6:44 PM
Answer

Jeffrey Handa

LIFERAY STAFF

Rank: Expert

Posts: 423

Join Date: December 1, 2008

Recent Posts

Have you tried this with a new user? If you were previously logged in, it will remember your preferences, even if you clear the cache and cookies.
Jeffrey Handa
RE: Default Edit Controls to invisible
May 4, 2009 8:36 PM
Answer

Jeffrey Handa

LIFERAY STAFF

Rank: Expert

Posts: 423

Join Date: December 1, 2008

Recent Posts

Monte Glenn Gardner:
(this is for liferay 5.1.1 and 5.1.2


I tested this with 5.1.2, but it should also work with 5.1.1.
Jeffrey Handa
RE: Default Edit Controls to invisible
May 4, 2009 8:43 PM
Answer

Jeffrey Handa

LIFERAY STAFF

Rank: Expert

Posts: 423

Join Date: December 1, 2008

Recent Posts

Monte Glenn Gardner:
What is the relationship of init.vm to init_custom.vm. If I have a theme with no init.vm in its templates folder, does the system execute an init.vm from some other location before executing my init_custom.vm?


When you deploy a theme, the build script first applies the _unstyled theme, then the _styled theme and finally the _diffs folder from your custom theme. If you have downloaded the portal source code, you can see the contents of the _unstyled and _styled themes in the following directory:

src\portal-web\docroot\html\themes\

You can take a look at the deployed war to see the result of this process.
Florent Teuber
RE: Default Edit Controls to invisible
June 10, 2009 7:23 AM
Answer

Florent Teuber

Rank: New Member

Posts: 4

Join Date: January 21, 2009

Recent Posts

Hi,
how can this work? $liferay_toggle_controls is used at the beginning of init.vm to build the CSS styles (controls-visible or controls-hidden). init_custom.vm is invoked from the last line of init.vm. So I do not see how this could change anything - but maybe there is something magically going on emoticon
Paul Brennan
RE: Default Edit Controls to invisible
August 18, 2009 8:03 AM
Answer

Paul Brennan

Rank: New Member

Posts: 4

Join Date: August 5, 2009

Recent Posts

I had this problem, but managed to solve it.
I have some custom css that makes toggle edit controls style various divs and wanted this to be OFF when a user is not signed in.
Although $liferay_toggle_controls was being set to invisible, the styles wern't being applied and so digged into init.vm, which contained the lines:

#set ($liferay_toggle_controls = $sessionClicks.get($request, "liferay_toggle_controls", "visible"))

#if ($liferay_toggle_controls == "visible")
#set ($css_class = $css_class + " controls-visible")
#else
#set ($css_class = $css_class + " controls-hidden")
#end

So the $css_class was being set before the init_custom.vm was being called. I replicated these lines in init_custom.vm and changed visible to invisible in the first line:

#set ($liferay_toggle_controls = $sessionClicks.get($request, "liferay_toggle_controls", "invisible"))

#if ($liferay_toggle_controls == "visible")
#set ($css_class = $css_class + " controls-visible")
#else
#set ($css_class = $css_class + " controls-hidden")
#end


Hope this helps some people
Secret Developer
RE: Default Edit Controls to invisible
September 11, 2009 10:02 AM
Answer

Secret Developer

Rank: Expert

Posts: 278

Join Date: June 23, 2009

Recent Posts

Hello,

When you turn toggle edit controls on, users can also see the "This portlet has been undeployed. Please redeploy it or remove it from the page" notification. I want users to see the icons (edit,configuration, look and feel, close) in the portlet windows, but I don't want to show them the notification.

Is there a way to hide this notification? Or is there a way to turn toggle edit controls but still make the icons (edit,configuration, look and feel, close) visible?

Baris
Dhrutika Vyas
RE: Default Edit Controls to invisible
September 23, 2009 12:12 PM
Answer

Dhrutika Vyas

Rank: Expert

Posts: 435

Join Date: February 9, 2009

Recent Posts

Baris Sener:
Hello,

When you turn toggle edit controls on, users can also see the "This portlet has been undeployed. Please redeploy it or remove it from the page" notification. I want users to see the icons (edit,configuration, look and feel, close) in the portlet windows, but I don't want to show them the notification.

Is there a way to hide this notification? Or is there a way to turn toggle edit controls but still make the icons (edit,configuration, look and feel, close) visible?

Baris



Hi Baris,
You can try this.go to configuration and unmark remove border.

Thanks,
Dhrutika Parekh

Cignex Technologies Pvt Ltd
Secret Developer
RE: Default Edit Controls to invisible
September 23, 2009 6:47 PM
Answer

Secret Developer

Rank: Expert

Posts: 278

Join Date: June 23, 2009

Recent Posts

I'm not sure if I follow; Do you mean the portlet's configuration? There is no remove border under configuration. If you mean look&feel, and then unclick show borders; it wouldn't be a good solution since I'll have to locate all the pages the notifications appear. What if there are undeploy notifications I haven't seen?

Baris
Dhrutika Vyas
RE: Default Edit Controls to invisible
September 23, 2009 9:53 PM
Answer

Dhrutika Vyas

Rank: Expert

Posts: 435

Join Date: February 9, 2009

Recent Posts

Hi Baris,
I mean to uncheck show border's through portlet configuration.
But as per your requirement it's not useful to you.

Thanks,
Dhrutika Parekh
Victor Zorin
RE: Default Edit Controls to invisible
September 23, 2009 10:23 PM
Answer

Victor Zorin

Rank: Liferay Legend

Posts: 1174

Join Date: April 14, 2008

Recent Posts

Hey Baris, you probably can get rid of this notification one way or another, but it just tells you that the portlet is not available in a system. Is this a portlet which you forgot to deploy, or an old portlet which you no longer need? Why would you want to keep place for this portlet on the page?

May be for later deployment? If that's the case and for whatever reason you would like to reserve space for portlets to be developed and deployed later, make dummy ones that produce zero rendering.
Secret Developer
RE: Default Edit Controls to invisible
September 24, 2009 5:46 AM
Answer

Secret Developer

Rank: Expert

Posts: 278

Join Date: June 23, 2009

Recent Posts

Hello Victor,

It usually appears when I remove a portlet from a page, even though it is still deployed in the portal. I don't want the notification to appear, or keep a place for the portlet on the page.

Do you know where I can find the portlet that outputs the notification?

Baris
Victor Zorin
RE: Default Edit Controls to invisible
September 24, 2009 2:55 PM
Answer

Victor Zorin

Rank: Liferay Legend

Posts: 1174

Join Date: April 14, 2008

Recent Posts

it should not appear if portlet was legitimately removed from the page, only when page constructed but portlet with given id is not found in a system.
- Definition of a message is in content/Language(_en).propeties
- Jsp responsible for rendering this message is html/portal/undeployed_portlet.jsp
Secret Developer
RE: Default Edit Controls to invisible
September 24, 2009 8:59 PM
Answer

Secret Developer

Rank: Expert

Posts: 278

Join Date: June 23, 2009

Recent Posts

Thank you Victor. I'll look into those.

I have one more problem emoticon Is there a way to hide the requests portlets when toggle edit controls are visible? When toggle edit controls are invisible, and there are no requests; the requests portlets is hidden. But if I turn toggle edit controls are on, then users can see the portlet.

Baris
Victor Zorin
RE: Default Edit Controls to invisible
September 24, 2009 11:24 PM
Answer

Victor Zorin

Rank: Liferay Legend

Posts: 1174

Join Date: April 14, 2008

Recent Posts

What do you mean by 'request portlets' ?

Baris, by looking at your questions, I suspect you need to get some clarity on your page layouts and portlet use. If you do not want users to see some portlets, why would those portlets be deployed on a page?

If you have very special setup and still do not want to see portlet controls in some specific cases, you will have to dig into your theme and redesign portlet.vm. There you can make smart on-the-fly decisions whether to display controls or not.
atul patel
RE: Default Edit Controls to invisible
September 25, 2009 5:54 AM
Answer

atul patel

Rank: Regular Member

Posts: 190

Join Date: November 17, 2006

Recent Posts

Sounds like you have a portlet that has additional functionality and should only be visible when toggle edit is on.

You will probably need to add the same $css-class that the toggled controls have to the content in your portlet, or the portlet itself depending on what you are doing. I believe liferay via jQuery search for objects with that class and toggles them class-visible and class-hidden. (Sorry i don't recall the name of the exact classes. )

Hope that helps.
Secret Developer
RE: Default Edit Controls to invisible
September 25, 2009 5:55 AM
Answer

Secret Developer

Rank: Expert

Posts: 278

Join Date: June 23, 2009

Recent Posts

I meant "Requests Portlet". It shows you if you have any friendship requests, or if you are an admin/owner of a community it shows you pending membership requests. The problem is; it comes without borders by default, so if you do toggle edit controls on, it shows everything in writing. Just like web content display.

Basically I want to have toggle edit controls on, but I don't want to display the portlet options if show borders in unchecked.

Is there a way to override how toggle edit controls work and what it turns on and off?

Baris
Attachment

Attachment

Attachments: toggle_off.jpg (19.6k), toggle_on.jpg (19.3k)
Gonzalo Jimenez
RE: Default Edit Controls to invisible
October 22, 2009 7:18 AM
Answer

Gonzalo Jimenez

Rank: New Member

Posts: 1

Join Date: October 22, 2009

Recent Posts

If you need to solve this on 5.2.2 you can do it adding this lines to init_custom.vm

#set ($liferay_toggle_controls = "hidden")
#set ($css_class = $theme_display.getColorScheme().getCssClass() + " controls-hidden")
John Croft
RE: Default Edit Controls to invisible
March 5, 2010 9:42 AM
Answer

John Croft

Rank: New Member

Posts: 10

Join Date: February 15, 2010

Recent Posts

I tried this and ended up with both classes on the body tag...

body class=" controls-hidden controls-visible"

How about adding your own class to the body tag in portal_normal.vm

<body class="$css_class #if($is_signed_in)loggedin #else notloggedin #end"
Debasis Padhi
RE: Default Edit Controls to invisible
July 22, 2013 5:02 AM
Answer

Debasis Padhi

Rank: Junior Member

Posts: 53

Join Date: March 23, 2012

Recent Posts

try this

$("body").removeClass("controls-visible").addClass("controls-hidden");
Saroj Nayak
RE: Default Edit Controls to invisible
July 22, 2013 6:29 AM
Answer

Saroj Nayak

Rank: New Member

Posts: 9

Join Date: May 16, 2012

Recent Posts

thanks ....
I tryed this It is reflecting in my desktop but not reflecting in iPad...
Debasis Padhi
RE: Default Edit Controls to invisible
July 22, 2013 6:33 AM
Answer

Debasis Padhi

Rank: Junior Member

Posts: 53

Join Date: March 23, 2012

Recent Posts

try this



#set ($isIpad = $request.getHeader("User-Agent").indexOf("iPad")!=-1)
#set ($liferay_toggle_controls = $sessionClicks.get($request, "liferay_toggle_controls", "visible"))
#if ($liferay_toggle_controls == "visible")
#set ($css_class = $css_class + " controls-visible")
#else
#set ($css_class = $css_class + " controls-hidden")
#end
#if($isIpad)
#set ($liferay_toggle_controls = "invisible")
#end

or else you can try

.portlet-borderless-bar, .portlet-topper-toolbar{display: none;} inside your css file for ipad ...