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

Sibling node name id and identifying them in path browser

Avatar

Avatar
Validate 1
Level 2
RonakB
Level 2

Likes

6 likes

Total Posts

41 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Ignite 5
Ignite 3
Ignite 1
Give Back 5
View profile

Avatar
Validate 1
Level 2
RonakB
Level 2

Likes

6 likes

Total Posts

41 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Ignite 5
Ignite 3
Ignite 1
Give Back 5
View profile
RonakB
Level 2

10-10-2018

Hi All,

When same component is used more than one time under same parsys, it is created using unique id like mycomponent_1526332 and so on.

Now when content author tries to reference any of those 4-5 instances created in another page using path browser, they can not differentiate between them as it shows like mycompnent_1234433, mycompnent_3243555 etc.

Question is :

1. Is it possible to control how this ID is created when node is created and we can give more meaningful name like mycomponent_01, mycomponent_02 ?

2. Is it possible to display some meaningful name in the path browser other than node name (which is only possible to know using crx/de access) ?

I am using AEM 6.3 SP2 CF1

Replies

Avatar

Avatar
Validate 25
Level 10
smacdonald2008
Level 10

Likes

1,408 likes

Total Posts

12,671 posts

Correct Reply

2,278 solutions
Top badges earned
Validate 25
Validate 10
Validate 1
Give back 900
Give back 600
View profile

Avatar
Validate 25
Level 10
smacdonald2008
Level 10

Likes

1,408 likes

Total Posts

12,671 posts

Correct Reply

2,278 solutions
Top badges earned
Validate 25
Validate 10
Validate 1
Give back 900
Give back 600
View profile
smacdonald2008
Level 10

15-10-2018

Its still very bad practice to read a component under  /content/mysite/somepage and try and re-use that component in another page. Each component has its own props. For example - if you want an image on PAGE A and then an image component on PAGE B  and PAGE C - reading the component on PAGE A under /content/MySite/PageA and putting that component onto content/MySite/PageB and content/MySite/PageC  - not best practice. You should use an experience fragment if you want to put duplicate components on other pages.

Avatar

Avatar
Establish
MVP
Veena_Vikram
MVP

Likes

471 likes

Total Posts

1,039 posts

Correct Reply

121 solutions
Top badges earned
Establish
Coach
Contributor 2
Seeker
Ignite 5
View profile

Avatar
Establish
MVP
Veena_Vikram
MVP

Likes

471 likes

Total Posts

1,039 posts

Correct Reply

121 solutions
Top badges earned
Establish
Coach
Contributor 2
Seeker
Ignite 5
View profile
Veena_Vikram
MVP

16-10-2018

Agree with PuzanovsP

Avatar

Avatar
Validate 1
MVP
raj_mandalapu
MVP

Likes

124 likes

Total Posts

203 posts

Correct Reply

72 solutions
Top badges earned
Validate 1
Contributor
Shape 1
Give Back 5
Give Back 3
View profile

Avatar
Validate 1
MVP
raj_mandalapu
MVP

Likes

124 likes

Total Posts

203 posts

Correct Reply

72 solutions
Top badges earned
Validate 1
Contributor
Shape 1
Give Back 5
Give Back 3
View profile
raj_mandalapu
MVP

16-10-2018

If you are authoring all common components on this page /content/mysite/global/  and referring authored components on other pages then I feel we can use EventListener I know you guys have already discussed on this but based on the below assumptions I feel it is a good approach for this requirement because

As per my understanding, we are going to author components only on the global page and I feel for every website there would be only one global page. if this is the case then we can configure to execute listener for the only global page. I don't see much performance impact here and also we need to execute listener only when the node is created and for other operations, we do not need to execute. I think you need to consider below things also when we choose listener how frequently you are going to delete and add components. as these are common components so I feel there would be less number of delete and add operations. if you think the operations are heavy also I prefer Listener as I am going to execute this only on the author not on publish. I don't know why are we avoiding Listeners here. correct me If I am wrong

Avatar

Avatar
Validate 25
Level 10
smacdonald2008
Level 10

Likes

1,408 likes

Total Posts

12,671 posts

Correct Reply

2,278 solutions
Top badges earned
Validate 25
Validate 10
Validate 1
Give back 900
Give back 600
View profile

Avatar
Validate 25
Level 10
smacdonald2008
Level 10

Likes

1,408 likes

Total Posts

12,671 posts

Correct Reply

2,278 solutions
Top badges earned
Validate 25
Validate 10
Validate 1
Give back 900
Give back 600
View profile
smacdonald2008
Level 10

16-10-2018

Raja - nice answer. For ppl reading this - Adobe still recommended using components in a page as described in this online tutorial - Getting Started with AEM Sites - WKND Tutorial . Use editable templates and then in each editable template - define a Policy that lets authors have access to a set of components. Then at the page level - authors drag and drop components onto a page and set the component properties via a Touch UI component dialog - that reflects best practice.

Furthermore - for code reuse - you can use experience fragments too within pages based on editable templates.

Avatar

Avatar
Validate 1
Level 2
RonakB
Level 2

Likes

6 likes

Total Posts

41 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Ignite 5
Ignite 3
Ignite 1
Give Back 5
View profile

Avatar
Validate 1
Level 2
RonakB
Level 2

Likes

6 likes

Total Posts

41 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Ignite 5
Ignite 3
Ignite 1
Give Back 5
View profile
RonakB
Level 2

16-10-2018

Agree but as discussed earlier wanted a more fine tuned way of doing it other than Listener / Post Processor. Seems like there is no direct way to achieve this. Still waiting for any discussion around @ nameHint param.

Avatar

Avatar
Validate 1
MVP
raj_mandalapu
MVP

Likes

124 likes

Total Posts

203 posts

Correct Reply

72 solutions
Top badges earned
Validate 1
Contributor
Shape 1
Give Back 5
Give Back 3
View profile

Avatar
Validate 1
MVP
raj_mandalapu
MVP

Likes

124 likes

Total Posts

203 posts

Correct Reply

72 solutions
Top badges earned
Validate 1
Contributor
Shape 1
Give Back 5
Give Back 3
View profile
raj_mandalapu
MVP

16-10-2018

I always prefer KISS policy instead of making things complex, I do not like overwriting nameHint param for a simple requirement if you find any solution on nameHitn param, request you please share with us. fine-tuned way means in terms of what  ? are you expecting on performance ?  or maintenance? or something else?

Avatar

Avatar
Coach
MVP
Arun_Patidar
MVP

Likes

1,356 likes

Total Posts

3,228 posts

Correct Reply

917 solutions
Top badges earned
Coach
Contributor 2
Ignite 10
Give Back 700
Boost 1000
View profile

Avatar
Coach
MVP
Arun_Patidar
MVP

Likes

1,356 likes

Total Posts

3,228 posts

Correct Reply

917 solutions
Top badges earned
Coach
Contributor 2
Ignite 10
Give Back 700
Boost 1000
View profile
Arun_Patidar
MVP

17-10-2018

Hi,

nameHint parameter you can get in filter servlet but modifying or adding name parameter can be risky. I would suggest you should go with JCR Events

Sling Filter to get nameParam

@Override

  public void doFilter(final ServletRequest request, final ServletResponse response, final FilterChain filterChain)

  throws IOException, ServletException {

  final SlingHttpServletRequest slingRequest = (SlingHttpServletRequest) request;

  final SlingHttpServletResponse slingResponse = (SlingHttpServletResponse) response;

  // logger.info("filter start : {} ", slingRequest.getParameter("./sling:resourceType"));

   if(slingRequest.getParameter("./sling:resourceType")!=null) {

   if(slingRequest.getParameter("./sling:resourceType").toString().equals("AEM63App/components/content/title")) {

   logger.info("nameHint param : {} ", slingRequest.getParameter(":nameHint"));

  }

  }

  filterChain.doFilter(request, response);

  // logger.info("filter end");

  }

Modify/Overwrite existing param

How To: Safely add or modify Servlet request parameter values | Dynamic | JSF 2 | | OCPsoft