telecasterrok
telecasterrok

Reputation: 209

Sitecore database: get url for content tem from GUID

I have the exported databases for a site that was on Sitecore. What is the relationship needed to find the URL/path for a a content item? For example, say I have article in Web db , items table, with GUID='x'.

Is the URL for that resource stored in another table? I was thinking maybe it is built from the Links table in the Core db, but I can't figure out the relationship. Thanks!

Upvotes: 0

Views: 537

Answers (1)

Jay S
Jay S

Reputation: 7994

In order to retrieve the URL, you should typically install a Sitecore instance with the correct configurations the site was running with and invoke the LinkManager API code with the GUID so you can determine what the URL was at the time the site was running.

Configurations affect the URL generation, as does the parent-child relationship mentioned by @jammykam.

URLs also are dependent on the language being viewed. For example, if you view a particular 'GUID' in english US, there may be an 'en-us' part in the URL. In french, the same 'GUID' may have 'fr-fr' in the URL. But, again, depending on configurations, it may not if it's a single-language site and is not enforcing language as part of the URL.

There are also some items, such as wildcards, which have a GUID but can have many URLs as they are intended to resolve a variety of possible URLs and then programmatically determine what to load.

In the end, I do not recommend using the GUID and the database to determine the URL.

Upvotes: 0

Related Questions