I have created a custom tab in cq: dialog of page component, Now i wish to allow the custom page property tab on a particular template not on every template.
Solved! Go to Solution.
Topics help categorize Community content and increase your ability to discover relevant content.
Views
Replies
Total Likes
Hi @Anilkumar9
Update Component Dialog:
Open the dialog for your page component (located at /apps/<your_project>/components/content/page/dialog).
Add a Template-specific Condition:
Inside the dialog XML, find the <cq:dialog> node that represents your dialog.
Add a cq:template node inside the cq:dialog node with the jcr:primaryType set to nt:unstructured.
Use the sling:resourceType property to specify the path to your custom tab implementation. This will ensure that the tab is only included when the page is based on the specified template.
<cq:dialog jcr:primaryType="nt:unstructured"
sling:resourceType="cq/gui/components/authoring/dialog">
...
<cq:tabs jcr:primaryType="nt:unstructured">
...
<yourCustomTab
jcr:primaryType="cq:Widget"
sling:resourceType="your/project/components/content/page/dialog/customTab"
cq:showOnTemplate="/apps/your/project/templates/yourTemplate"/>
...
</cq:tabs>
...
</cq:dialog>
Replace /apps/your/project/templates/yourTemplate with the path to the template where you want your custom tab to appear.
Replicate the Configuration:
If you have multiple templates where you want the custom tab to appear, replicate the <yourCustomTab> configuration inside the <cq:tabs> node for each template.
You have overridden the default page dialog. Your every template pagetype is created form this page. Thats why you are getting the dialog on every template.
There is two way
One:
Templates are always based on a page. So go to the pagetype of your template. Now override the dialog here instead of overriding on default page.
Two:
Go to each template and create cq_dialog/content.xml. Then just configure which items you want to hide.
Check the screenshot
@Anilkumar9 Did you find the suggestions from users helpful? Please let us know if more information is required. Otherwise, please mark the answer as correct for posterity. If you have found out solution yourself, please share it with the community.
Views
Replies
Total Likes
Views
Likes
Replies
Views
Likes
Replies