Version number of the last published component

In CM, we created components and published them. Following publication, changes to the components have been made. We wanted to know the version number of the published component. I could not find this information from the GUI. When I looked at the database, I could see the version information in the element table, while the item_states table has publication information, but it does not contain a link to the version. Now, with this information, I have to write a complex query comparing publication dates in the item_states and item tables.

Is there an alternative (simpler) way to find this information?

+4
source share
2 answers

SDL Tridion does not store version information for published items, so it is really not accessible through a graphical interface or API.

Basically, there are two ways to β€œguess” this information:

  • Use the API to find the version of an item at the time it is published.

  • Request a database for this information

The second option may seem easier if you are in database queries, but let me remind you that this is an unsupported option. The SDL Tridion data model is not publicly available, which means that it should not remain the same in new versions. Therefore, if you request a database, your decision will not necessarily be future proof.

+2
source

In addition to the other options mentioned, you can:

  • Implement a system-wide event code that responds to events that fire when a component is saved and when it is successfully published

  • In your templates, dynamically add metadata to the presentation of the component when they are published, which makes the version (and possibly another) available as metadata in the broker database.

As Arjen said, we can help you with more details about your problem.

+1
source

All Articles