Foros de discusión

Removal of dock bar from liferay.

thumbnail
Rojalin Patri, modificado hace 12 años.

Removal of dock bar from liferay.

Expert Mensajes: 287 Fecha de incorporación: 22/03/11 Mensajes recientes
Hi all,
i have a requirement which needs the dockbar should be removed from liferay and instead a single link will be available at the header which will enable the admin only to add "web content".
Let me explain it clearly...in general when we click on a"add application' present in dock bar we get a number of options like "sample",content management" etc.but i want the dock bar to be removed and in replacement one link will be there clicking on which it'll directly add only "web content display" portlet (present under content management).Other options present under add application is not required not even content management.
So first i added the following piece of code in "portal-normal.vm" to accomplish this.
#set($portlet_url = $portletURLFactory.create($request, "56", $page.getPlid(), "ACTION_PHASE"))
$portlet_url.setWindowState("maximized")
$portlet_url.setPortletMode("view")
$portlet_url.setParameter("_spage", "/journal_content/view")
<a href="${portlet_url.toString()}">my portlet link</a>
but upon clicking on the link it's refreshing the page and all other portlets present on the page is not visible.
I went through the link "http://www.liferay.com/community/wiki/-/wiki/Main/Link+to+Dockbar".Using this approach i am able to add "Add Application" option in the header,but i don't want the whole "add application".
Can anyone tell me how to take only the "web content display" out of the "add application"???????????
Please help me out....

Thanks
Rojalin
Nisarg Parikh, modificado hace 12 años.

RE: Removal of dock bar from liferay.

Expert Mensajes: 262 Fecha de incorporación: 31/12/09 Mensajes recientes
Hi,

Dockbar is a portlet implementation.
You can find the implementation of this dockbar under below path.

"ROOT.war//html/portlet/dockbar/view.jsp"

you can create a HOOK to override the current functionality.

Hope this will help you.

Nisarg Parikh
thumbnail
Rojalin Patri, modificado hace 12 años.

RE: Removal of dock bar from liferay.

Expert Mensajes: 287 Fecha de incorporación: 22/03/11 Mensajes recientes
Hi Nisarg,
i am able to remove the dock bar from the header.But my problem is instead of dockbar i want to add one link which will allow me to add "web content portlet" just as we do clicking on the "add application".i want upon clicking on that i should get the "web content Display" portlet in my home page but the user/admin should not be able to see the other options present under "Add application".
please help me out...

Thanks
Rojalin
Nisarg Parikh, modificado hace 12 años.

RE: Removal of dock bar from liferay.

Expert Mensajes: 262 Fecha de incorporación: 31/12/09 Mensajes recientes
Hey,

which version of Liferay you are using?

What I suggest is, do NOT remove the whole dockbar. Remove all other links/images etc which are not needed. By using this you do not have to worry about the adding portlet to pages functionality. Liferay will take care of all other aspects also. And creating hook that will be very easy.

In Liferay 6 you can configure that which portlet you want using portal-ext.properties.

##
## Dockbar Portlet
##

#
# Set the portlet ids that will be shown directly in the "Add Application"
# menu.
#
dockbar.add.portlets=56,101,110,71

You can set the ID of "Web Content" portlet and remove all other.

Please review image for your reference.

Archivos adjuntos:

thumbnail
Rojalin Patri, modificado hace 12 años.

RE: Removal of dock bar from liferay.

Expert Mensajes: 287 Fecha de incorporación: 22/03/11 Mensajes recientes
Hi Nisarg,
i am using liferay6.0.6 and my first requirement is to remove the dock bar.Instead the client wants a link where i can get only web-content portlet.So there is no point of disabling other option of "add application".it's completely a new requirement and the dialogue box of "add application" also shouldn't come.i am attaching the screen shot for please reference.now upon clicking on the link i am able to get the portlet interface (i mean the title "web content display","return to full screen")but i am getting error "you don't have roles" error message with no exception in the logs.please help me out.....
Nisarg Parikh, modificado hace 12 años.

RE: Removal of dock bar from liferay.

Expert Mensajes: 262 Fecha de incorporación: 31/12/09 Mensajes recientes
Rojalin Patri:
Hi Nisarg,
i am using liferay6.0.6 and my first requirement is to remove the dock bar.Instead the client wants a link where i can get only web-content portlet.So there is no point of disabling other option of "add application".it's completely a new requirement and the dialogue box of "add application" also shouldn't come.i am attaching the screen shot for please reference.now upon clicking on the link i am able to get the portlet interface (i mean the title "web content display","return to full screen")but i am getting error "you don't have roles" error message with no exception in the logs.please help me out.....



Hi,

PFA screenshot. Is this the thing what you want? and upon clicking on that it will add the "Web Content Display" portlet, right?

What I did is remove the unwanted links and changed the CSS of the docbar so it looks like we have put the link specifically for "Web Content Display" portlet.

let other things be as it is.

And if you want to open a portlet in MAXIMIZED mode then you have to change one parameter of renderURL of portlet.

You can find that code in below file
/html/portlet/journal_content/view.jsp

Hope this will help you.

Nisarg Parikh

Archivos adjuntos:

thumbnail
Rojalin Patri, modificado hace 12 años.

RE: Removal of dock bar from liferay.

Expert Mensajes: 287 Fecha de incorporación: 22/03/11 Mensajes recientes
Hi Nisarg,
i think you didn't understand the requirement.i am attaching the screen shots here for a clear understanding.in web.png the link "My web content Display"is there in top left corner.upon clicking on that i should get the web content display portlet.though i m able to add the link but it's showing "roles not there error".
Do you have any idea how can we take out the web content display portlet from add application or any path/address to that portlet which i can give in href for the link present in web.png.that would satisfy the requirement...
Thanks
Rojalin
Nisarg Parikh, modificado hace 12 años.

RE: Removal of dock bar from liferay.

Expert Mensajes: 262 Fecha de incorporación: 31/12/09 Mensajes recientes
Rojalin Patri:
Hi Nisarg,
Do you have any idea how can we take out the web content display portlet from add application or any path/address to that portlet which i can give in href for the link present in web.png.that would satisfy the requirement...


Hi Rojalin,

If I am not wrong you want too remove the "Web Content Display" portlet from Add - > Application (which is in Dockbar). Please read below:

In Liferay 6 you can configure that which portlet you want using portal-ext.properties. remove the 56 no portlet. That will remove this portlet from Add -> Application

# Set the portlet ids that will be shown directly in the "Add Application"
# menu.
#
dockbar.add.portlets=101,110,71


AND

regarding the code you can find this code in below files
"/html/portlet/layout_configuration/view.jsp" and
"/html/portlet/layout_configuration/view_category.jsp"

You will get idea of how you can get link that will work fine.

Hope this will help you.

Nisarg Parikh
thumbnail
Namrata Hangal, modificado hace 12 años.

RE: Removal of dock bar from liferay.

Regular Member Mensajes: 161 Fecha de incorporación: 27/07/10 Mensajes recientes
Nisarg Parikh:


In Liferay 6 you can configure that which portlet you want using portal-ext.properties. remove the 56 no portlet. That will remove this portlet from Add -> Application

# Set the portlet ids that will be shown directly in the "Add Application"
# menu.
#
dockbar.add.portlets=101,110,71


AND

regarding the code you can find this code in below files
"/html/portlet/layout_configuration/view.jsp" and
"/html/portlet/layout_configuration/view_category.jsp"



Hi Nisarg,

Actually, I think what Rojalin is trying to say is not "removing" the Add Web Content Display literally speaking, but "separating it out"!
As is visible in the screenshots, there is a simple hyperlink "Add Web Content Display" on the portal page. On click, a web content display should be added to the page in the same manner as using the Dockbar option would work.

Any idea how to do this?

Thanks!
Nisarg Parikh, modificado hace 12 años.

RE: Removal of dock bar from liferay.

Expert Mensajes: 262 Fecha de incorporación: 31/12/09 Mensajes recientes
Namrata Hangal:


On click, a web content display should be added to the page in the same manner as using the Dockbar option would work.

Any idea how to do this?



Hi Namrata,

Regarding the code thing you can find that code in below files..

"/html/portlet/layout_configuration/view.jsp" and
"/html/portlet/layout_configuration/view_category.jsp"

You can understand that how Liferay has shown the categories and portlet and the link they have set for Dockbar..the same way you can implement.

Nisarg Parikh
Fatema Rajkotwala, modificado hace 12 años.

RE: Removal of dock bar from liferay.

New Member Mensajes: 2 Fecha de incorporación: 17/02/12 Mensajes recientes
Hi Rojalin,
I am facing the same issue
I want the link on liferay home page and on clicking that link my portlet should get loaded on home page
The code that I have written is:

#set ($portlet_url = $portletURLFactory.create($request, "ChangePassword_WAR_ChangePasswordportlet", $page.getPlid(),"RENDER_PHASE"))
$portlet_url.setWindowState("normal");
$portlet_url.setPortletMode("view")
$portlet_url.setParameter("jspPage","/view.jsp")
Accesing the portlet from the below link:
<a href="$portlet_url.toString()" id="change-pwd">my link</a>

Have you solved the problem that you were facing
Is it that there is something more that needs to be set to access the portlet
Please help me out it is urgent..
thumbnail
Rojalin Patri, modificado hace 12 años.

RE: Removal of dock bar from liferay.

Expert Mensajes: 287 Fecha de incorporación: 22/03/11 Mensajes recientes
Hi,
i have done it in the following way.
Step 1:Remove the below code from portal_normal.vm file which is in your customized theme
#if(($is_signed_in)&&($permissionChecker.isOmniadmin()))
#dockbar()
#end
Steps 2:Add below code snippet where you want. Ex:In this given example case "Add New Web content Display portlet" is the link
if ( $layout.getFriendlyURL() == $dashboardPage)
#set ($checkMM = $roleLocalService.hasUserRole($user.getUserId(), $company.getCompanyId(), $marketingManagerRoleName, true))
#if (($is_signed_in)&&($checkMM=="true"))
<p id='addportletlink'><a href="/web/guest/login">Edit Login </a></p>
<p id='addportletlink'><a href="#" onclick="javascript:add()">Add New Web content Display Portlet</a></p>
#end
#end
Steps 3:
Javascript functionality of add() is below. (Note : portlet Id of Webcontent display portlet is '56')
function add(){
var plid = themeDisplay.getPlid();
var portletId = '56';
var onComplete = null;
var beforePortletLoaded = null;

var portletOptions = {
beforePortletLoaded: beforePortletLoaded,
onComplete: onComplete,
plid: plid,
portletId: portletId,
};
Liferay.Portlet.add(portletOptions);
document.write("<META HTTP-EQUIV='Refresh' CONTENT='2'>");
}

Hope this helps....
Regards
Rojalin
Pietro Recchilongo, modificado hace 11 años.

RE: Removal of dock bar from liferay.

New Member Mensajes: 3 Fecha de incorporación: 17/12/12 Mensajes recientes
Rojalin Patri:
Hi Nisarg,
i think you didn't understand the requirement.i am attaching the screen shots here for a clear understanding.in web.png the link "My web content Display"is there in top left corner.upon clicking on that i should get the web content display portlet.though i m able to add the link but it's showing "roles not there error".
Do you have any idea how can we take out the web content display portlet from add application or any path/address to that portlet which i can give in href for the link present in web.png.that would satisfy the requirement...
Thanks
Rojalin



How do you remove the "Go to" tab near the user sign out?
I saw that in your pictures in this post there is one with that tab on it a some later without the TAB "Go to".

Thank you for any advice

Pietro
thumbnail
Hari Dobbala, modificado hace 11 años.

RE: Removal of dock bar from liferay.

Junior Member Mensajes: 29 Fecha de incorporación: 18/11/12 Mensajes recientes
Hi Pietro,

We removed "Go to" tab in docbar by commenting the code related to Go To in ROOT\html\portlet\dockbar\view.jsp and deployed it using hook. This is the one option. I don't know if there are any other options available.
utkarsh champ, modificado hace 10 años.

RE: Removal of dock bar from liferay.

New Member Mensajes: 6 Fecha de incorporación: 16/05/13 Mensajes recientes
Hi Hari,

We have 3 community or you can say role, based on role i want to load the default page. Same way i want to get rid out of Docbar and Go To option.

Is that doable to remove Go To option based on role and also specify the default page?

BR,
Utkarsh
thumbnail
Namrata Hangal, modificado hace 12 años.

RE: Removal of dock bar from liferay.

Regular Member Mensajes: 161 Fecha de incorporación: 27/07/10 Mensajes recientes
Nisarg Parikh:

PFA screenshot. Is this the thing what you want? and upon clicking on that it will add the "Web Content Display" portlet, right?

What I did is remove the unwanted links and changed the CSS of the docbar so it looks like we have put the link specifically for "Web Content Display" portlet.

let other things be as it is.

And if you want to open a portlet in MAXIMIZED mode then you have to change one parameter of renderURL of portlet.

You can find that code in below file
/html/portlet/journal_content/view.jsp


This is the exact functionality we'd like to have - minus the dockbar modification method of doing it. Instead of making changes to the dockbar (which we're tried and customer wouldn't like to have), we'd like to have a simple link on the portal page to do the same thing.

I hope I could explain my requirement....?