Try our conversational search powered by Generative AI!

Page full path


I am creating a job in CMS 11 and I need to get the full path of the page for my report that I am creating.  Here is what I have and I know I can run SQL to get it but trying to avoid that if possible.  What I would like it to return is something like this "Root/AS/Franchises/Shared/Franchise Defaults/Fallback Site/Home/Underwriting/Products/Life/News and  Events/".  I can get that by running my SQL and passing the page.ContentLink.ID but I want to learn the C# way of doing it.  Thanks for the help.  

var _loader = ServiceLocator.Current.GetInstance<IContentLoader>();
// Get all descendants of the Shared site
var pages = _loader.GetDescendents(SharedSite).Select(c => _loader.Get<IContent>(c)).ToList();

// Iterate them...
            foreach (var page in pages)
                Log($"Start: \"{page.Name}\" (ID: {page.ContentLink.ID})");

Jun 28, 2023 14:06

Hi Scott,

Take a look at this blog post should have everthing you need:

Just be aware scheduled jobs are run it a different context or without context you can read more about how they work here:


Jun 28, 2023 15:04
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.