Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn More

View all

Sign in to view all badges

Implement Navigation as Inherited Component

Avatar

Avatar
Validate 1
Level 1
ruchim71073425
Level 1

Like

1 like

Total Posts

11 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Ignite 1
Boost 1
View profile

Avatar
Validate 1
Level 1
ruchim71073425
Level 1

Like

1 like

Total Posts

11 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Ignite 1
Boost 1
View profile
ruchim71073425
Level 1

26-01-2021

Hi all,

 

We are using AEM 6.4.
Looking for a suggestion on implementing the following feature.

We have multiple types of users that get redirected to a separate section of the website based on their role after login.

The navigation is different for every section. I want to somehow define the navigation at the home page of the section and then let all children inherit it. I don't want to create multiple templates just to have different navigation.
Noticed that InheritanceValueMap doesn't allow inheriting nodes/resources but just properties, so can't use that feature.

 

Is there any other way to implement this iParsys kind of feature?

 

Thanks

Ruchi

Replies

Avatar

Avatar
Coach
Employee
Jörg_Hoh
Employee

Likes

1,079 likes

Total Posts

3,117 posts

Correct Reply

1,060 solutions
Top badges earned
Coach
Give back 600
Ignite 5
Ignite 3
Ignite 1
View profile

Avatar
Coach
Employee
Jörg_Hoh
Employee

Likes

1,079 likes

Total Posts

3,117 posts

Correct Reply

1,060 solutions
Top badges earned
Coach
Give back 600
Ignite 5
Ignite 3
Ignite 1
View profile
Jörg_Hoh
Employee

26-01-2021

Hi,

 

My recommendation is to think about 3 aspects:

* How would you manage and design any single navigation? Should it require a developer to craft it? Or do you require it to be defined by an author using some kind of UI?

* Next is the mapping of the "role" to a specific navigation? Where is this maintained? Defined by a user/super-user? Admin? AEM developer?

* And finally the easiest question: How do you want to include this navigation into the page?

 

I would start with the details of the requirements and try to answer the first question first. One thing you could use is a Content Fragment or Experience Fragment to model to model the navigation. There is already an editor, tooling etc available for it.

For the mapping of role to navigation you probably need some type of dialog (multi-value), which allows you select a group name in a drop down and which allows to specify a navigation you created before.

 

When you have done that, you need to think about how it can be easily integrated into the page rendering process. I would opt to design specific a specific MainNavigation class, which encapsulates the CF/XF and is able to map that CF/XF into a navigation. The selection of the correct navigation based on inheritance is something I would hide within a adapter pattern, so you could use something like:

 

page.adaptTo(MainNavigation.class).firstLevel().foreach(...)

 

Focus first on the design, on the content structure and all the requirements. Coding is then the easiest part.