Hi, I am trying to generate a menu navigation tree with all the pages of my website. I have typed the following code for that purpose:
<%@ page import="org.opencms.jsp.*" %> <% // Create a JSP action element CmsJspActionElement cms = new CmsJspActionElement(pageContext, request, response);
// List of all pages / subfolders (sorted by NavPos property) java.util.List list = cms.getNavigation().getSiteNavigation(); java.util.Iterator i = list.iterator();
// Now build the navigation
while (i.hasNext()) { CmsJspNavElement ne = (CmsJspNavElement)i.next(); out.println("<a href=\"" + cms.link(ne.getResourceName()) + "\">" + ne.getNavText() + "</a>"); out.println(ne.getNavTreeLevel()); if (i.hasNext()) { out.println("<br>"); } } %>
The result it is only a blank screen. Why? I have tried to use the getNavigationTreeForFolder method whith the correct parameters of levels given by the getNavTreeLevel method and I have got only a list of the folders in the current level. I can't achieve to display the items of lower levels.
Would anybody help me? Thanks
JR
_______________________________________________ This mail is send to you from the opencms-dev mailing list To change your list options, or to unsubscribe from the list, please visit http://mail.opencms.org/mailman/listinfo/opencms-dev
Jesus Rodriguez 18 November 2004 14:34:24 [ permanent link ]
Hi all again. I have just tested that the code that I posted before works OK on OpenCms version 5, but does NOT WORK on OpenCms version 6 alpha2.
_______________________________________________ This mail is send to you from the opencms-dev mailing list To change your list options, or to unsubscribe from the list, please visit http://mail.opencms.org/mailman/listinfo/opencms-dev
Waehrisch & Feykes GmbH Hartmann 18 November 2004 14:50:46 [ permanent link ]
When you call your page you have to switch to the site it is in. I.e. if your page ist /sites/default/index.html you have to switch to /sites/default/. It won't work while you are in site /. Alternatively you can move your pages to site / during development.
Regards, Stephan
----- Original Message ----- From: "Jesus Rodriguez" <rodpemail-opencms@yahoo.es> To: <opencms-dev@opencms.org> Sent: Thursday, November 18, 2004 12:34 PM Subject: [opencms-dev] getSiteNavigation does not work. Why????
Hi all again. I have just tested that the code that I posted before> works OK on OpenCms version 5, but does NOT WORK on OpenCms version 6> alpha2.>
_______________________________________________> This mail is send to you from the opencms-dev mailing list> To change your list options, or to unsubscribe from the list, please visit> http://mail.opencms.org/mailman/listinfo/opencms-dev>
_______________________________________________ This mail is send to you from the opencms-dev mailing list To change your list options, or to unsubscribe from the list, please visit http://mail.opencms.org/mailman/listinfo/opencms-dev
Joachim Arrasz 18 November 2004 14:52:40 [ permanent link ]
Hi,
Hi all again. I have just tested that the code that I posted before > works OK on OpenCms version 5, but does NOT WORK on OpenCms version 6 > alpha2.
you should change from com.opencms.* to org.opencms.*
Maybe there are also some little modifications needed for methods you use ...
Hope this helps
Bye Achim
_______________________________________________ This mail is send to you from the opencms-dev mailing list To change your list options, or to unsubscribe from the list, please visit http://mail.opencms.org/mailman/listinfo/opencms-dev
Jesus Rodriguez 18 November 2004 15:24:05 [ permanent link ]
Thank you very much Stephan, now it works. I was runnig the code from "/" site. Once I have changed to my own site it works ok
Thanks again
Regards, JesГєs.
_______________________________________________ This mail is send to you from the opencms-dev mailing list To change your list options, or to unsubscribe from the list, please visit http://mail.opencms.org/mailman/listinfo/opencms-dev
hi friends(Jesєs and Stephan) , thanks you sooooooooooooooooooooooooooooooooooo................................ mcuhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh i was also strugling so... much and i got it ...
If you would like to report an abuse of our service, such as a spam message, please . Если Вы хотите пожаловаться на содержимое этой страницы, пожалуйста .