Cannot remove component with responsivegrid from editable template

Avatar

Avatar
Validate 1
Level 2
srinir44531418
Level 2

Likes

2 likes

Total Posts

8 posts

Correct reply

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

Avatar
Validate 1
Level 2
srinir44531418
Level 2

Likes

2 likes

Total Posts

8 posts

Correct reply

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

26-03-2019

We have a component with a coded in responsive grid (code below). When we add this component to the editable template, template author could not delete any more.

Search on forums turned up something that vaguely referenced Synthetic Resource and need to create content using cq:template.

Appreciate if anyone can explain WHY this type of component, once added to the template, cannot be deleted. And any workaround without having to ask template authors to add content (to satisfy responsive grid) before being able to delete the component from template (structure).

<div data-sly-resource="${'content' @ resourceType='wcm/foundation/components/responsivegrid'}"></div>

Replies

Avatar

Avatar
Validate 25
Level 10
smacdonald2008
Level 10

Likes

1,410 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,410 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

26-03-2019

Typically components added to an editable template cannot be deleted by an author. Do not put in components into a responsive grid at the editable template level. Should be placed in the page level to let authors add/delete a component.

Avatar

Avatar
Validate 1
Level 2
srinir44531418
Level 2

Likes

2 likes

Total Posts

8 posts

Correct reply

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

Avatar
Validate 1
Level 2
srinir44531418
Level 2

Likes

2 likes

Total Posts

8 posts

Correct reply

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

27-03-2019

Perhaps I have to elaborate on the issue. Here is how to reproduce:

1. Lets say we have two components - Component A and Component B.

2. Component A has simple HTL, say

<h1>This is Component A</h1>

3. Component B has following HTL

<h1>This is Component B</h1>

<div data-sly-resource="${'content' @ resourceType='wcm/foundation/components/responsivegrid'}"></div>

4. As "Template Author", edit a blank template and add Component A and Component B to the template in "Structure" mode.

5. As "Template Author", try to delete Component A and Component B from the Template.

Result:

1. As Template Author, you will see "Delete" option for Component A but NOT for Component B.

All of this usecase is on Template itself, not on a page and not as regular page author /editor.

Here is the thread I found on the same topic. adobe - Not able to remove components in Editable Template AEM - Stack Overflow

Hope this clarifies the issue.

Avatar

Avatar
Coach
MVP
Arun_Patidar
MVP

Likes

1,462 likes

Total Posts

3,328 posts

Correct reply

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

Avatar
Coach
MVP
Arun_Patidar
MVP

Likes

1,462 likes

Total Posts

3,328 posts

Correct reply

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

27-03-2019

Hi,

As suggested; for quick fix, you can

  • Add content to the responsive grid in the component you are trying to delete.
  • Refresh the page
  • Delete the structure component

Avatar

Avatar
Validate 1
Level 2
srinir44531418
Level 2

Likes

2 likes

Total Posts

8 posts

Correct reply

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

Avatar
Validate 1
Level 2
srinir44531418
Level 2

Likes

2 likes

Total Posts

8 posts

Correct reply

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

27-03-2019

Thanks. I am trying to understand why it behaves the way it does. And a programmatic fix rather than having to ask Template Authors to go through the work of putting content in, just to remove the component they just added to the template.

Avatar

Avatar
Validate 25
Level 10
smacdonald2008
Level 10

Likes

1,410 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,410 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

27-03-2019

Your authors should be working with components (adding, modifying, nd deleting) at page level. The components that an author works with are defined within the policies in editable templates. This reflects best practice.

Only components set in an editable templates are fixed components that an author cannot modify.

Avatar

Avatar
Validate 25
Level 10
smacdonald2008
Level 10

Likes

1,410 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,410 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

27-03-2019

see the weekend tutorial for info on editable templates, components, and best practice around responsive grid --Getting Started with AEM Sites - WKND Tutorial

Avatar

Avatar
Coach
MVP
Arun_Patidar
MVP

Likes

1,462 likes

Total Posts

3,328 posts

Correct reply

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

Avatar
Coach
MVP
Arun_Patidar
MVP

Likes

1,462 likes

Total Posts

3,328 posts

Correct reply

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

27-03-2019

Hi @srinir44531418

The issue is when you create dropzone using parsys or responsive grid, the node(e.g. content) is created when the component is dropped, here the node is not getting created that causing the issue.

But we can force node creation using cq:template.

To enable deletion for component B, follow the below step:

  1. update component B code as below;
    <h2>This is Component B</h2>
    <div data-sly-resource="content"></div>
  2. Create cq:template node under componentB(CompB)
  3. Create content node under cq:template node and add sling:resourceType property to content node

      sling:resourceType = wcm/foundation/components/responsivegrid

1720198_pastedImage_8.png

Avatar

Avatar
Give Back
Level 1
vijaymnnit06
Level 1

Like

1 like

Total Posts

2 posts

Correct reply

0 solutions
Top badges earned
Give Back
Boost 1
View profile

Avatar
Give Back
Level 1
vijaymnnit06
Level 1

Like

1 like

Total Posts

2 posts

Correct reply

0 solutions
Top badges earned
Give Back
Boost 1
View profile
vijaymnnit06
Level 1

01-10-2020

Hi @Arun_Patidar 

 

I am also facing the same issue. I tried creating cq:template node and putting relevant node under this. Followed all the steps as suggested but still delete option is not coming. Even I am not using any cq:actions under cq:editConfig node. Followed the suggestions at https://stackoverflow.com/questions/50447249/not-able-to-remove-components-in-editable-template-aem as well but somehow not working for me. I am using AEM 6.5. Is there any other approach?

Avatar

Avatar
Coach
MVP
Arun_Patidar
MVP

Likes

1,462 likes

Total Posts

3,328 posts

Correct reply

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

Avatar
Coach
MVP
Arun_Patidar
MVP

Likes

1,462 likes

Total Posts

3,328 posts

Correct reply

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

01-10-2020

can you check for new page, for existing pages, cq:template has no effect.