WCM navigator component customization - Displaying siblings when there is no child siteareas (Linking two navigators)

Following article shows how to design the navigator for the following scenario

If SiteArea has child siteareas then display the child SiteAreas and  
if SiteArea does not have child SiteAreas then display Sibling Siteareas

Example:

ParentSitearea1
   |
   --->ChildSiteArea1
   |          |
   |          --->SubChildSiteArea1
   |          |
   |          --->SubChildSiteArea2
   |
   --->ChildSiteArea2
   |
   --->ChildSiteArea3
             

Excepted output
when we click on ChildSiteArea1, display "SubChildSiteArea1 and SubChildSiteArea2"  (child siteareas)
when we click on ChildSiteArea2, display "ChildSiteArea1 ,ChildSiteArea2 and ChildSiteArea3" (Siblings)
when we click on SubChildSiteArea1, display "SubChildSiteArea1 and SubChildSiteArea2" (Siblings)


Steps
1. Create Navigator component (ChildSiteAreaNavigator) to pull child siteareas when click on parent sitearea. Select following options


Start Type: Current Site Area
Selected Start Area: None
Include Start: false
Ancestor Level: None
Descendant Level: 1 Level
Preceding Siblings Level: None
Next Siblings Level: None
Show Site: false
Show Content: false
Expand current navigator branch one level: true
Expand navigator to display current site area: false
Results per page: 10
Start page: 1
Maximum pages to include: 10
Pages to read ahead: 10
Distinguish items with no children using the final navigator result design: true


Header:  <ul>
Footer:  </ul>
Separator:
Navigator result design 1:

<li class="leftNav"><span ><a href='<Placeholder tag="href"/>' class="navItem" ><Placeholder tag="name"/></a></span>
</li>

No result design:
<Component name="sivavaka_library/SiblingsNavigator"/>





2. Create another Navigator component (SiblingsNavigator) to pull siblings siteareas when click on sitearea. Select following options


Start Type:Current Site Area
Selected Start Area:None
Include Start:true
Ancestor Level:None
Descendant Level:None
Preceding Siblings Level:All
Next Siblings Level:All
Show Site:false
Show Content:false
Expand current navigator branch one level:true
Expand navigator to display current site area:false
Results per page:10
Start page:1
Maximum pages to include:10
Pages to read ahead:10
Distinguish items with no children using the final navigator result design:true

Header:  <ul>
Footer:  </ul>
Separator:
Navigator result design 1:
<li class="leftNav"><span><a href='<Placeholder tag="href"/>' target="" title="" class="navItem"><Placeholder tag="name"/></a></span>
</li>

Basically above two navigator components are connected , you just refer single navigator component to display results as expected

3 comments:

  1. hi siva,

    could you pls let us know if we can achieve to display an "option selection" element type as image for each of the options in the authoring template. I have a scenario where in author need to select one of the images when creating content using an authoring template.

    ReplyDelete
    Replies
    1. Sorry for the late response , but this can be done by pointing custom JSP to element on the authoring template.

      Delete
  2. Hey Siva, Can u provide some custom code snippet to use top access the content item in a library and render the same on the page.

    ReplyDelete