How to create Navigation Node in Hybris using Impex ? How to map categories to navigation nodes ? How to map category landing pages or PLP to navigation nodes ? How to establish relation between navigation bar and jsp page ?
1 Answers
In import/sampledata/contentCatalogs/yourCatalog/cms-content.impex
after filling the macros with your project specific definitions:
INSERT_UPDATE CMSNavigationNode;uid[unique=true];$contentCV[unique=true];name;children(uid,$contentCV)[mode=append]
;root;;root;;
##- level 1. SiteRoot -##
INSERT_UPDATE CMSNavigationNode;uid[unique=true];$contentCV[unique=true];name;parent(uid, $contentCV);links(&componentRef);&nodeRef
;SiteRootNode;;SiteRootNode;root;;SiteRootNode
##-- level 2. children of SiteRoot --##
INSERT_UPDATE CMSNavigationNode;uid[unique=true];$contentCV[unique=true];name;parent(uid, $contentCV);links(&componentRef);&nodeRef
;YOUR-SITE-NAMENavNode;;YOUR-SITE-NAME Site;SiteRootNode;;YOUR-SITE-NAMENavNode
##--- level 3. children of <YOUR-SITE-NAME>NavNode ---##
INSERT_UPDATE CMSNavigationNode;uid[unique=true];$contentCV[unique=true];name;parent(uid, $contentCV);links(&componentRef);&nodeRef
;YOUR-SITENAMECategoryNavNode;;Categories;YOUR-SITE-NAMENavNode;;YOUR-SITE-NAMECategoryNavNode
##---- level 4. children of Category Nav ----##
INSERT_UPDATE CMSNavigationNode;uid[unique=true];$contentCV[unique=true];name;parent(uid, $contentCV);links(&linkRef);&nodeRef
;FIRST-CATEGORYNavNode;;FIRST-CATEGORY;YOUR-SITE-NAMECategoryNavNode;;FIRST-CATEGORYNavNode
## entries of the above navigation nodes ##
INSERT_UPDATE CMSNavigationEntry;uid[unique=true];$contentCV[unique=true];name;navigationNode(&nodeRef);item(CMSLinkComponent.uid,CMSLinkComponent.$contentCV);
;FIRST-CATEGORYNavNodeEntry;;FIRST-CATEGORY Navigation Node Entry;FIRST-CATEGORYNavNodeFIRST-CATEGORYCategoryLink;
## links of the above navigation nodes ##
INSERT_UPDATE CMSLinkComponent;$contentCV[unique=true];uid[unique=true];name;url;&linkRef;&componentRef;target(code)[default='sameWindow']
;;FIRST-CATEGORYCategoryLink;FIRST-CATEGORY Category Link;/Open-Catalogue/FIRST-CATEGORY/c/FIRST-CATEGORY-ID;FIRST-CATEOGRYCategoryLink;FIRST-CATEGORYCategoryLink;
Keep in mind that
/c/FIRST-CATEGORY-ID
is leading to the category with this id. You also have to have the Page template configured incoredata/contentCatalogs/yourCatalog/cms-content.impex
(this impex is usually filled by the hybris system automatically) related to the SearchResults page so that the products in the category appear.You have to configure your root category in the projectNamecore extension in the spring xml
<bean id="PROJECT-NAMECategorySource" parent="abstractCategorySource"> <property name="rootCategory" value="ROOT-CATEGORY-NAME"/> </bean> <bean id="PROJECT-NAMECategoryCodeValueProvider" parent="abstractCategoryCodeValueProvider"> <property name="categorySource" ref="PROJECT-NAMECategorySource"/> </bean> <bean id="PROJECT-NAMECategoryNameValueProvider" parent="abstractCategoryNameValueProvider"> <property name="categorySource" ref="PROJECT-NAMECategorySource"/> </bean>
This is done so that hybris knows your category system and so that it is able to give the right results and configure the PATH in the pages.
ROOT-CATEGORY
- the main category that is the parent of all categories;
PROJECT-NAME
- your project name;
SITE-NAME
- your site name;
It will be easier for you if you take a look at the powertoolsstore/apparelstore/electronicsstore
or more accurately the cms content impex in the sampledata of the projects so that you have the main idea.
Hope it helps!

- 1,753
- 4
- 20
- 30

- 21
- 1
-
Thanks for replying, can you tell me what is significance of 2nd point configuring root category in the projectNamecore extension ? is it mandatory ? – ashish Jul 14 '17 at 13:31
-
Yes, it is. In this way when you try to access a category with /c/categoryId in the url, hybris will know where to look for and what path to display. Hope it was helpful! – Teodora Petkova Jul 21 '17 at 08:59