Hippo Tip: New Agenda Item in Left Sidebar

Let's add a new item in the left sidebar of a Hippo application... for our site's agenda items. It's slightly tricky since you don't simply want to add a new link to a page. Instead, you want to add new metadata and content into the JSR 283 repo that is beneath Hippo. So, there's the default website that the Hippo Maven archetype gives you (the "site" module):

...and what we want to achieve in this blog entry is to have a new item "agenda" right below "news":

This is how to achieve the above, assuming your Hippo project is named "CarSalesSite":

  1. In your "site" module's source code, there's a "beans" package in "src". Copy "NewsDocument.java" and name it "AgendaDocument.java". Inside this document, change "CarSalesSite:newsdocument" to "CarSalesSite:agendadocument".

  2. In the Hippo CMS, go to "Configuration", copy "newsdocument" and name it "agendadocument". Now commit the new document type.

  3. In the Hippo CMS, go to "Documents", and create a new "translated folder" on the same level as "Common" and "News". Name that new folder "Agenda". Within that folder, create another folder, named "2011". Within that folder, publish one or two documents of your new "agendadocument" type.

  4. Now go to the CMS Console. In "hst:hst/hst:configurations/CarSalesSite/hst:sitemenus/main", copy "news" and name it "agenda". Within "agenda", change the value of "hst:referencesitemapitem" to "agenda".

  5. In "hst:hst/hst:configurations/CarSalesSite/hst:sitemap", copy the "news" folder and name it "agenda". On the level of the folder, as well as the files, change the value of "hst:relativecontentpath" to "agenda". Write the changes to the repository.

Now you'll need to undeploy the "site" module, rebuild it, and run the application again from scratch, since you have a new bean in it, unless you're using some kind of automatic refresh functionality, such as is available natively in NetBeans IDE, also for Maven projects.

Comments:

Post a Comment:
  • HTML Syntax: NOT allowed
About

Geertjan Wielenga (@geertjanw) is a Principal Product Manager in the Oracle Developer Tools group living & working in Amsterdam. He is a Java technology enthusiast, evangelist, trainer, speaker, and writer. He blogs here daily.

The focus of this blog is mostly on NetBeans (a development tool primarily for Java programmers), with an occasional reference to NetBeans, and sometimes diverging to topics relating to NetBeans. And then there are days when NetBeans is mentioned, just for a change.

Search

Archives
« April 2014
SunMonTueWedThuFriSat
  
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today