Sign in

E-mail *, (xx@domain.com)
Password *

Register | Forgot password

Title, Title, Title and Title

The "WCB: JSP front-end design" forum contains threads on issues that are related to JSP front-end design while programming a WCB (WebManager Component Bundle). The Presentation & Element component contain JSPs that will be used for front-end rendering. Ask your questions related to these JSPs here. Some example topics: integration of AJAX, use of the taglibs, how to handle multiple websites, and so forth.

Answered
Not marked as answered yet

Forums  >  WCB: JSP Front-end design  >  Title, Title, Title and Title


Author Title, Title, Title and Title
DennisvG


Posts: 3

Posted: 12-07-2010 17:13

Hi,

I'm trying to rewrite a pagepart that handles navigation on our site and am running into a small problem.

The problem is that the current navigation uses plain text to describe the link when you hover over it using ${subPageCurrent.title}.

This title is used for SEO on our website so we can't change this title, we're trying to pull the info from the other title field but I keep getting "javax.el.PropertyNotFoundException: Property 'FriendlyURLTitle' not found" errors.

I've gone through the API and I can't get any of the mentioned title fields to work, for some reason it only works when I use ${subPageCurrent.title}.

I've tried FriendlyURLTitle, HTMLTitle, NavigationTitle, with and without .page. and some other variations that "should" work but I keep getting error 500's that the property was not found. Maybe I'm calling it wrong, the last things I tried was looking it up as ${subPageCurrent.page.FriendlyURLTitle}.

Can someone explain to me what all these different title's mean and where they are coming from? Our installation only has 2 title fields on the pages and they appear to not be the ones mentioned in the API since only .title works and nothing else

Thanks in advance for any help,

Dennis

SPeter


Posts: 6

Posted: 12-07-2010 17:29 Helpful

Dennis, please try navigationTitle; if i'm correct camelcase should do the trick

williamb



Posts: 310

Posted: 12-07-2010 18:41 Solved

In addition to Peter, the trick behind it is the following:

1. On http://connect.gxsoftware.com/api/webmanager/javadoc/index.html?nl/gx/... you'll find all methods that are supported.

2. search for what you want.
e.g. getFriendlyURLTitle()
or getHtmlTitle()
or getNavigationTitle()
or getTitle()
or getUrlTitle()

3. To use this in JSP: remove the 'get' or 'is' and lowercase the next letter, and remove the ().
e.g. friendlyURLTitle
e.g. htmlTitle
etc.

now you'll have ${pageVersion.htmlTitle}, which should work :).
(note: it's the pageVersion that has a title, a Page object does not have a title!)


So, that's the trick with the correct camelcase.


More information about this standard JSP behaviour, you can find at http://www.ibm.com/developerworks/java/library/j-jstl0211.html#N10227.

More information about what titles you can use is available in http://connect.gxsoftware.com/Software/Documentation.htm#GXD0016


- title - the title of the page/media item itself.
- navigationtitle - (pages only) the page‘s navigation title. This is the default setting for creating the url's.
- urltitle - the page/media item‘s URL title (only visible for editors if enabled, see GXD0016)



I noticed you try to get a 'page' from PageVersion's getSubPagesWithCurrent(), but that already returns an array of pages.

williamb



Posts: 310

Posted: 12-07-2010 18:45


Just as a handy tip:

Try to start from the presentationcontext top object, this is the only object your page-part (and any other presentation) always has.

<c:set var="pages" value="${presentationcontext.pageVersion.subPagesWithCurrent}"/> should give you an array of page-objects that are published and marked as 'show in navigation'. On this array you can do ${page.current.title} in a forEach loop that sets (var) page on all (items) pages.

You can also check out the Community Edition Style navigation.jspf for more examples. And you are, of course, always welcome at the Design Fundamentals course.

DennisvG


Posts: 3

Posted: 13-07-2010 11:15

Thanks Peter and William.

It works now with subPageCurrent.navigationTitle but when trying with pageVersion it gives the same error. It's odd though because in the same jspf we're using ${((fn:startsWith(pageVersion.labels[labelPageVersionNum]... to determine if you're on a specific logged in page to highlight that page in the site navigation.

A colleague allready offered to look at it because he also found it odd

Thanks again,

Dennis

PS I'm having a hard time posting this reply, this is the third time I'm trying to post it, I hope the forum cooperates this time.

williamb



Posts: 310

Posted: 13-07-2010 14:44

Hi Dennis,

I wonder too. Please let us know what was going on ;)

p.s. The forum should be fixed now.

Back to top

New message: "Title, Title, Title and Title"
Message:
bold boitalicd underline url quote code smile cool eek grin mad razz sad wink
 
© 2012 GX Software B.V.

Disclaimer

This website (Connect.gxsoftware.com) may discuss or contain opinions, (sample) coding, software or other information that does not include GX official interfaces, instructions or guidelines and therefore is not supported by GX. Changes made based on this information are not supported.  GX will not be held liable for any damages caused by using or misusing the information, software, instructions, code or methods suggested on this website, and anyone using these methods does so at his/her own risk. GX offers no guarantees and assumes no responsibility or liability of any type with respect to the content of this website, including any liability resulting from incompatibility between the content of this website and the materials and services offered by GX. By using this website you will not hold, or seek to hold, GX responsible or liable with respect to the content of this website.