Can Page Naming Conventions be cumtomized? | Community
Skip to main content
LiYanfei
Level 2
March 10, 2022
Solved

Can Page Naming Conventions be cumtomized?

  • March 10, 2022
  • 2 replies
  • 1274 views

I want to cumtomize the Naming Convention rules and add a sequence id to page name.

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by lukasz-m

Hi @liyanfei, in terms of technical approach that could be used, I see following options:

Backend oriented - in general it will apply the change after page was created or copy/pasted.

Mix of frontend and backend - this approach assures that desired page name is generated before it is saved in the repository.

  • Create Sling servlet that will generate/expose sequence id you would like to add to the page name. Create javascript that will call the servlet and will automatically update page name on page creation/update GUI wizard.

 

2 replies

Anmol_Bhardwaj
Community Advisor
Community Advisor
March 10, 2022

Can you explain a little bit:

- Do you need to change name of existing pages?

- If you crate new page, you have to name the page. Do you want this to be automated/customized so that it takes a default value?

LiYanfei
LiYanfeiAuthor
Level 2
March 10, 2022

- Not applied for existing pages. Applied for page create and page copy.

- I want to be automated/customized.

Anmol_Bhardwaj
Community Advisor
Community Advisor
March 10, 2022

I think @lukasz-m covered almost all the ways you can achieve this. 

You can achieve the same by going any of the ways described.

 

- Backend Oriented : Best way to go for Long Term Support.

- Frontend Oriented : Fastest and easiest way, although , you may need to make changes if Adobe changes the class names of the dialog in a new SP or version.

 

I would personally go with the front end oriented as it cannot impact performance.

Just write a event listener on "Create Page" button in JS and write a small function which will automatically add the filename/pattern you are looking for through code.

lukasz-m
Community Advisor
lukasz-mCommunity AdvisorAccepted solution
Community Advisor
March 10, 2022

Hi @liyanfei, in terms of technical approach that could be used, I see following options:

Backend oriented - in general it will apply the change after page was created or copy/pasted.

Mix of frontend and backend - this approach assures that desired page name is generated before it is saved in the repository.

  • Create Sling servlet that will generate/expose sequence id you would like to add to the page name. Create javascript that will call the servlet and will automatically update page name on page creation/update GUI wizard.

 

BrianKasingli
Community Advisor and Adobe Champion
Community Advisor and Adobe Champion
March 10, 2022

This is a fairly clean approach. Nice one!