Forums

Home » Liferay Portal » English » 3. Development

Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
Shahzad . Hussain
site map portlet show or hide child page
April 29, 2009 10:25 PM
Answer

Shahzad . Hussain

Rank: Junior Member

Posts: 52

Join Date: May 26, 2008

Recent Posts

Hi friends....

is it possible to manipulate the Site Map portlet so you could minimize and maximize the parent pages to either show or hide the child pages within them (depending on what the user wanted to show).I am using Liferay522 version.

Waiting for reply
Thanks in advance
Oliver Bayer
RE: site map portlet show or hide child page
April 30, 2009 12:47 AM
Answer

Oliver Bayer

Rank: Liferay Master

Posts: 883

Join Date: February 18, 2009

Recent Posts

Hi,

I've not done it this way so far but it should be possible if you edit the "webapps \ ROOT \ html \ portlet \ site_map \ view.jsp". There a two private functions to build the output of the site-map portlet recursively which you can modify to suit your needs. Maybe you can use something like the jQuery accordion functionality.
Shahzad . Hussain
RE: site map portlet show or hide child page
April 30, 2009 1:58 AM
Answer

Shahzad . Hussain

Rank: Junior Member

Posts: 52

Join Date: May 26, 2008

Recent Posts

Hi ,i tried changing in view.jsp of site map portlet, bt i am unable to find any solution. If u have any code regarding this plz share wt me.
Oliver Bayer
RE: site map portlet show or hide child page
May 2, 2009 1:29 PM
Answer

Oliver Bayer

Rank: Liferay Master

Posts: 883

Join Date: February 18, 2009

Recent Posts

Hi Tannu,

as a first try I set up the jQuery accordion funtion to work with the site-map in view.jsp. I don't have much time for testing but as a first attempt I tried following:
  • added the jQuery.accordion in the portal-ex.properties to the barebone section
  • created a new boolean variable to check if the actual element is a child page
  • add this boolean parameter to _buildSiteMap function
  • change <ul>-tag to <div id="accordion"> and <li> to <div>
Insert the following code snippet at the end of the site-map view.jsp:
1<script type="text/javascript">
2jQuery('#accordion').accordion({ header: "h3" });
3</script>

The accordion function (hide sub-elements) works for firefox but not for ie. And the elements of the sitemap aren't clickable links (work only if you right click them and open in new tab).
It's not much nor a working solution but maybe you can use this hint for coding a working jsp. Otherwise you can try and hide sub-elements via javascript/jQuery but without the accordion function. Please let me know if you've coded a good solution.

Greets
Shahzad . Hussain
RE: site map portlet show or hide child page
May 21, 2009 2:45 AM
Answer

Shahzad . Hussain

Rank: Junior Member

Posts: 52

Join Date: May 26, 2008

Recent Posts

Hi Oliver Bayer finally i got solution, I just created new java script function inside the view.jsp of site map portlet and same java script function i call inside sb.append inside private void _buildLayoutView of view.jsp. It is working fine for all browsers.
Caroline Gessner
RE: site map portlet show or hide child page
December 4, 2009 2:09 AM
Answer

Caroline Gessner

Rank: Junior Member

Posts: 32

Join Date: November 22, 2009

Recent Posts

Would you mind explaining a little more or even share some code?
This does sound very interessting and helpful for the problem I have atm,
but I don't quite understand everything.

Would be very thankful.