Forums

Home » Liferay Portal » Pусский

Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
Rojalin Patri
Removal of dock bar from liferay.
June 28, 2011 8:45 PM
Answer

Rojalin Patri

Rank: Expert

Posts: 287

Join Date: March 22, 2011

Recent Posts

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
RE: Removal of dock bar from liferay.
June 29, 2011 1:50 AM
Answer

Nisarg Parikh

Rank: Expert

Posts: 262

Join Date: December 30, 2009

Recent Posts

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
Rojalin Patri
RE: Removal of dock bar from liferay.
June 29, 2011 2:07 AM
Answer

Rojalin Patri

Rank: Expert

Posts: 287

Join Date: March 22, 2011

Recent Posts

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
RE: Removal of dock bar from liferay.
June 29, 2011 2:33 AM
Answer

Nisarg Parikh

Rank: Expert

Posts: 262

Join Date: December 30, 2009

Recent Posts

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.
Attachment

Attachments: Portlet.png (18.8k)
Rojalin Patri
RE: Removal of dock bar from liferay.
June 29, 2011 9:04 PM
Answer

Rojalin Patri

Rank: Expert

Posts: 287

Join Date: March 22, 2011

Recent Posts

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.....
Attachment

Attachments: webContentDisplay.png (193.4k)
Nisarg Parikh
RE: Removal of dock bar from liferay.
June 30, 2011 1:03 AM
Answer

Nisarg Parikh

Rank: Expert

Posts: 262

Join Date: December 30, 2009

Recent Posts

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
Attachment

Attachments: Portlet.png (12.4k)
Rojalin Patri
RE: Removal of dock bar from liferay.
June 30, 2011 1:40 AM
Answer

Rojalin Patri

Rank: Expert

Posts: 287

Join Date: March 22, 2011

Recent Posts

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
Attachment

Attachment

Attachments: web.png (172.4k), web2.png (168.1k)
Nisarg Parikh
RE: Removal of dock bar from liferay.
June 30, 2011 3:38 AM
Answer

Nisarg Parikh

Rank: Expert

Posts: 262

Join Date: December 30, 2009

Recent Posts

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
Namrata Hangal
RE: Removal of dock bar from liferay.
June 30, 2011 3:46 AM
Answer

Namrata Hangal

Rank: Regular Member

Posts: 161

Join Date: July 26, 2010

Recent Posts

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!
Namrata Hangal
RE: Removal of dock bar from liferay.
June 30, 2011 3:52 AM
Answer

Namrata Hangal

Rank: Regular Member

Posts: 161

Join Date: July 26, 2010

Recent Posts

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....?
Nisarg Parikh
RE: Removal of dock bar from liferay.
June 30, 2011 4:48 AM
Answer

Nisarg Parikh

Rank: Expert

Posts: 262

Join Date: December 30, 2009

Recent Posts

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
RE: Removal of dock bar from liferay.
February 27, 2012 11:41 PM
Answer

Fatema Rajkotwala

Rank: New Member

Posts: 2

Join Date: February 16, 2012

Recent Posts

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..
Rojalin Patri
RE: Removal of dock bar from liferay.
March 7, 2012 1:53 AM
Answer

Rojalin Patri

Rank: Expert

Posts: 287

Join Date: March 22, 2011

Recent Posts

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
pinco pallino
RE: Removal of dock bar from liferay.
December 17, 2012 9:03 AM
Answer

pinco pallino

Rank: New Member

Posts: 3

Join Date: December 17, 2012

Recent Posts

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
Hari Dobbala
RE: Removal of dock bar from liferay.
December 17, 2012 11:34 PM
Answer

Hari Dobbala

Rank: Junior Member

Posts: 29

Join Date: November 17, 2012

Recent Posts

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
RE: Removal of dock bar from liferay.
May 16, 2013 11:20 AM
Answer

utkarsh champ

Rank: New Member

Posts: 6

Join Date: May 16, 2013

Recent Posts

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