Is there a relatively easy way to query the database to find all the pages that a form is being used on?

Vote:
 

I need to occassionally pull all the pages a form is being used on. It's typically within nested blocks of course. But it's not so often that I want to write a report in our website. Is there a way to get this information from a SQL query?

#334416
Dec 16, 2024 17:03
Vote:
 

Rather than querying the database, I reckon your best bet would be to use the IContentSoftLinkRepository which keeps track of what content links to what other content. To get a list of content which references a given piece of content you can do it like this:

var softLinkRepo = ServiceLocator.Current.GetInstance<IContentSoftLinkRepository>();
var links = softLinkRepo.Load(myContentReference, true);

If you've got nested blocks, you may need to look at the soft links for the soft links returned using the same technique.

#334454
Dec 17, 2024 9:51
* 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.