I have to customize page title textfield at page properties using jcr:title (Title) string by appending some fixed string every time. Have to programmatically achieve this before saving the page properties to JCR.
I am thinking to do this using JS, by assigning the pagetitle value before "SimpleSave" or "Save & Close" action is called.
Where I can make this change if my approach is correct ? I am unable to find the location or there is any better way of doing that ?
Hi, we had the same requirement to add a prefix to the title, we added a new field in the page property and read it when we created <title> tag, since this property always be available in JCR and you can reuse it, you can customize it as well. you can add default value as well to this new property to get autofill value on creating.
Your approach is correct. Create a clientlib with OOTB categories as "cq.authoring.dialog" (and dependencies as "cq.jquery") as it is needed only in author.
In the JS logic, amend the title conditionally (that is only if it doesn't contains the fixed string, otherwise for every submit of page properties dialog, title value will be amended with fixed string)