cancel
Showing results for 
Search instead for 
Did you mean: 

How to remove a component from a content slot from Impex?

Former Member
0 Kudos

Hi Experts

I want to create an impex to remove one component from the list of components in my contentSlot. e.g If I have 10 different components associated with my contentSlot and i want to remove just the 3rd component and rest remain the same. How can this be possible from Impex?

Thanks Rahul

Accepted Solutions (1)

Accepted Solutions (1)

0 Kudos

You need to replace the components list

something like this

INSERT_UPDATE ContentSlot ; $contentCV[unique = true] ; uid[unique = true] ; cmsComponents(uid, $contentCV)[mode=replace]

                         ;                            ;yourContentSlot                        ;nineComponents
Former Member
0 Kudos

Hi Deepesh

Thanks for your answer. But this solution did come to my mind but i want to remove just one and i don't know the component IDs of rest of the Components[nineComponents], but ID do know the ID of the one to remove. This solution will surely work i know that as well, but i was looking for an alternative. I have come up with a solution.

Thanks for your response Rahul

Former Member
0 Kudos

This is another approach to do this which i came up with I removed the relation between ContentSlot and Component. ElementsForSlot is the relation table between ContentSlot and Component.

Query to get PK of Relation Table of Content Slot and Component Select {pk} from {ElementsForSlot as efs},{ContentSlot as cs},{AbstractCMSComponent as comp} where {efs.source}={cs.pk} and {efs.target}={comp.pk} and {cs.uid}= 'Section1Slot-Homepage' and {comp.uid} = 'ourComponent' and {cs.catalogVersion} = '8796093448793'

Impex to remove this PK REMOVE ElementsForSlot;pk[unique=true] ;8796136506429

Former Member

Alternatively here is the impex to do this directly REMOVE ElementsforSlot entry:

REMOVE ElementsForSlot;source(catalogVersion(catalog(id),version),uid)[unique=true,allownull=true];target(catalogVersion(catalog(id),version),uid)[unique=true,allownull=true] ;electronicsContentCatalog:Online:Section1Slot-Homepage;electronicsContentCatalog:Online:splashbannercomponent

Answers (0)