Laliwala IT Services

Laliwala IT Services
Website Development

Thursday, February 24, 2011

How Listing children of current page with there URLs, Layout liferay, theme solution, theme.runtime, string liferay, liferay contain, page manages




























































































































































































































































































































































































































































































































































































Al-Mothafar Al-Hasan : Hi





How can I list children of page that visitor inside it , I mean the visitor must see the children of current page he view it








I wrote a vm code for that , but it just listing names without URLs , because .getURL() does not work ...








liferay url tutorial, liferay theme tutorial, liferay admin tutorial








$nav_child.getURL() does not work , it because $layout.getChildren return a list of LayoutImpl not NavItem , how I can do what I want by another way .. !!!






Mazhar Anwar : Hi Mothafar,








liferay page tutorial, liferay string tutorial, liferay iceface tutorial








Please try this code, it will work.






Al-Mothafar Al-Hasan : Thank you very much !





It's work.








emoticon

I'm very thankful






Al-Mothafar Al-Hasan : I have a new problem , its listing the child name for another languages too at the same time , how to solve this ?






Mazhar Anwar : Replace the













Hope this will work...emoticon






Al-Mothafar Al-Hasan :


Thank you very much emoticon , BUT what about private pages , I mean if you have a page that hidden or user have not permission to see this page , this is hard , i trying to find the solution emoticon






Al-Mothafar Al-Hasan : Now I need the solution of this , I used the $theme.runtime("71") to load navigation portlet in my theme , but its does not working it community !








Its retrieve empty in portlet for displayStyle = 6 , I need to be displayStyle = 1 , I was make a JSP hook and made this change to init.jsp








its work well and show me the navigation portlet in guest community , but in another its empty except String displayStyle = "6"; But i don't need this style ,








Anyway the alternative is this way, I mean the code that I wrote it here in this post , but there is 2 problems the language and I think it's solving with ($local) , and the another is the permission !








I need the solution of the permission problem OR the solution of navigation portlet , why displayStyle = "1"; not working in community pages..








Note : sorry for my English emoticon






Archi Madhu : Hi there,





You can use following methods of LayoutLocalServiceUtil.java





you can get public pages using








public static java.util.List<com.liferay.portal.model.Layout> getLayouts(

long groupId, boolean privateLayout, long parentLayoutId)








where groupid and plid you can get it from themeDisplay object.and pass privateLayout=false

and private pages








public static java.util.List<com.liferay.portal.model.Layout> getLayouts(

long groupId, boolean privateLayout, long parentLayoutId)








where groupid and plid you can get it from themeDisplay object.and pass privateLayout=true








and make a combined list of both of them and iterate it.








I haven't tried this but you can give a try.








Let me know if you need more clarification.

HTH!






Al-Mothafar Al-Hasan : Thank you for your hints





Actually i trying to use permission checker ($permissionChecker.contains() usong PortletPermissionUtil) but sometimes return errors and liferay stop too or not work and liferay working but show my sentence as a normal string








may this way was stupid , but I'm newbie in liferay and its just newbie tries emoticon






Archi Madhu : Why you are using PermisionChecker here?





seems it irrelevant






Al-Mothafar Al-Hasan : Why irrelevant !!!!!





I think when you go to page manages and select your page that you want to edit permission of it , and click permission button and disable view and others from community and enable it for others , the first thing you will thinking about it in theme is PermissionChecker !








I think !








i don't know , I feel it is relevant!

1 comment: