This chapter presents new features added to eXo Platform 3.5. At present, in this chapter, you will have opportunity to learn about one feature called Navigation By Content with the following specific topics:

You need to attach your root folder/node to some page nodes from the homepage (the drop-down menu holds your new contextual menu):

1. Go to the Content Explorer page and navigate to /site contents/live/acme/events/All.

2. Click the Content Navigation button.

3. Fill values into the navigation form, including:

4. Save changes, then go back to the Acme/Overview homepage.

You will see changes from the Events drop-down menu.

In which:

Click the Earth menu item from the contextual menu and see that contents of the Earth directory are rendered in a separate page (catalog):

Select the Power 1 - Fire menu item from the contextual menu to see the Fire content which is displayed in a separate page (details):

To restrict the visibility of some contents:

1. Go to the Content Explorer page and navigate under /site contents/live/acme/events/All/Fire.

2. Click the Content Navigation button.

3. Uncheck the field visible and save.

4. Go back to the homepage and see that the Fire sub-menu is not displayed in the contextual menu.

To sort elements of the contextual menu:

1. Go to the Content Explorer page and navigate under /site contents/live/acme/events/All.

2. Select the /site contents/live/acme/events/All/Earth node.

3. Click the Content Navigation button.

4. Set the Display order field to 1 and save.

5. Select the /site contents/live/acme/events/All/Water node.

6. Click the Content Navigation button.

7. Set the Display order field to 2 and save.

8. Select the /site contents/live/acme/events/All/Air node.

9. Click the Content Navigation button.

10. Set the Display order field to 3 and save.

11. Go back to the homepage and see that the display order from the contextual menu is sorted to Earth, Water, Air. Note that the Fire sub-menu is not displayed because it is set to "invisible" in the previous example.

To restore a node to the contextual menu (if you already removed it) and attach it to another page:

1. Go to the Content Explorer page and navigate under /site contents/live/acme/events/All/Fire.

2. Click the Content Navigation button.

3. Fill values into the navigation form fields, including:

4. Save changes and go back to the Acme/Overview homepage and see that the Fire node is attached to the News drop-down menu from the site menu:

However, if you want to add your newly created content directly to the contextual menu, you need to add the populateToMenu action first.

To add your newly created contents to the contextual menu:

1. Go to the Content Explorer page and navigate under /site contents/live/acme/events/All/Fire.

2. Click the Manage Actions button and add the exo:populateToMenu action.

3. Create a document under /site contents/live/acme/events/All/Fire (for example, uploading a file) and publish it.

4. Go back to the homepage and see that your newly created document is added to the contextual menu.

The sample ACME website comes with a configured navigation by content menu:

You can click the Vision sub-menu and see contents of vision directory rendered in the catalog page:

For example, select the X-Ray content and see the newly implemented content using new visual effects.

The product content is composed of fields and folders:

Folders are created within the product content when the name field is created.

This can be achieved (from the .gtmpl product dialog) as follows:

Other fields are created almost in the same way:

<%
private void setUploadFields(name) {
	String[] illustrationHiddenField1 = ["jcrPath=/node/medias/images/illustration", "nodetype=nt:file", "mixintype=mix:referenceable", "defaultValues=illustration"];
	String[] illustrationHiddenField2 = ["jcrPath=/node/medias/images/illustration/jcr:content", "nodetype=nt:resource", "mixintype=dc:elementSet", "visible=false"];
	String[] illustrationHiddenField3 = ["jcrPath=/node/medias/images/illustration/jcr:content/jcr:encoding", "visible=false", "UTF-8"];
	String[] illustrationHiddenField4 = ["jcrPath=/node/medias/images/illustration/jcr:content/jcr:lastModified", "visible=false"];
	String[] illustrationHiddenField5 = ["jcrPath=/node/medias/images/illustration/jcr:content/dc:date", "visible=false"];
	uicomponent.addHiddenField("illustrationHiddenField1", illustrationHiddenField1);
	uicomponent.addHiddenField("illustrationHiddenField2", illustrationHiddenField2);
	uicomponent.addHiddenField("illustrationHiddenField3", illustrationHiddenField3);
	uicomponent.addCalendarField("illustrationHiddenField4", illustrationHiddenField4);
	uicomponent.addCalendarField("illustrationHiddenField5", illustrationHiddenField5);
	String[] fieldImage = ["jcrPath=/node/medias/images/illustration/jcr:content/jcr:data"] ;
	uicomponent.addUploadField(name, fieldImage) ;
}
%>
<tr>
	<td class="FieldLabel"><%=_ctx.appRes("Product.dialog.label.illustrationImage")%></td>
	<td class="FieldComponent">
		<%
			String illustration = "illustration";
			if(ProductNode != null && ProductNode.hasNode("medias/images/illustration") && (uicomponent.findComponentById(illustration) == null)) {
				def imageNode = ProductNode.getNode("medias/images/illustration") ;
				def resourceNode = imageNode.getNode("jcr:content");
				if(resourceNode.getProperty("jcr:data").getStream().available() > 0) {
					def imgSrc = uicomponent.getImage(imageNode, "jcr:content");
					def actionLink = uicomponent.event("RemoveData", "/medias/images/illustration/jcr:content");
					%>
						<div>
							<image src="$imgSrc" width="100px" height="80px"/>
							<a onclick="$actionLink">
								<img src="/eXoResources/skin/DefaultSkin/background/Blank.gif" class="ActionIcon Remove16x16Icon"/>
							</a>
						</div>
					<%
				} else {
					setUploadFields(illustration);
				}
			} else {
				setUploadFields(illustration);
			}
		%>
	</td>
</tr>

Now let's look at the product's view form.

Illustration image, title and summary are grouped together:

1. Get the node path (document or video).

2. Use some customized CSS classes to display a link for this node.

Labels and/or messages displayed in the dialog and the view form are localized.

Note the use of this instruction as below:

This is achieved by adding locale files. For example:

Make sure that locale files are added to the resource bundle configuration. If locale files (dialogs and views) are under the classes/locale/wcm directory, use the following code: