5

I need to find out if a component is used in any published page using core service.

This needs to be displayed in a column using GUI extension for all the components in a publication.

If a component is used in any published page, we will show some message on the column in cms.

3
  • Welcome to Tridion Stack Exchange. Can you please share the tridion vession that you are using and can you also provide some more details on what you are trying to achieve.
    – Anand N S
    Feb 16 at 7:14
  • Also it would be useful to know what you've reviewed (there are many similar questions in TREX) and what you've tried... Feb 16 at 10:52
  • @AnandNS If a static component is present in a published page, we need to show some message like 'Component In Use in a Page' on a cms using GUI extension(may be through data extender). If component is not present in any published page we will show with some other message. Can this be achieved through these steps using core service - 1. Find a component if present in a page 2. If yes, find that if page is published. Please suggest. Feb 16 at 12:01

1 Answer 1

2

don't do that. It will be too much of a work for the core service to load that for each component in a folder per each browse. You will probably crash UI.

What you can do is still use the core service, but get PublishInfo for each of the component.

For example:

PublishInfoData[] publishInfoData = CoreServiceConnector.Client.GetListPublishInfo(item);

PublishInfoData contains all the details on which target item is published with which template and so on: enter image description here

I am providing you this solution because when you check where item is publish, component can be added with static template on a page, and you don't need to check the publish state of the page, you can check the state on the component itself.

2
  • thanks for help. But my requirement is something like this: "browse through each component in a folder -> check if component is present in any page -> if present, check if page is published -> if published, display some message for each component on cms using GUI extension" Now I need to know if i can find a way to check if component is present in any of the published page. Hope this is clear. Feb 24 at 6:05
  • you can do that. you need to check where used pear each component. see in which version of the page it was added. then compare publish dates for page and component to see if it was published in the more/less same time Feb 24 at 7:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.