on 05-04-2017 1:43 PM
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
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
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
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
User | Count |
---|---|
5 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.