Using scopes to associate custom table data

Anthony Romero asked on February 4, 2021 22:10

I want to be able to create a custom table where a user selects a scope and then supplies several other data points. Then as users browsers the site or as editors edit pages I would need to be able to determine which scope is being applied to the current page and look up the custom table item based on that scope. How do I determine which scope is currently being applied to a give page?

Recent Answers


David te Kloese answered on February 8, 2021 13:19

Sorry your logic is a bit unclear to me.

Do you first enter this scopes in the Custom table and need to find that when rendering/editing a page?

OR

When someone edits a page you want to insert a new "scope" in the Custom table automatically?

And what type of value would such a "scope" be? A category you determine, a property on a users profile or the specific section in the content tree the editor currently is at?

0 votesVote for this answer Mark as a Correct answer

Anthony Romero answered on February 8, 2021 14:57

I figured it out:

CMS.DocumentEngine.DocumentTypeScopeInfoProvider.GetScopeInfo(TreeNode node)

The idea would be I could associate the data in the custom table item to all of the items in which the scope on that item applies. Yes, the user would select the scope on the custom table item and that would server as the association between the items in the scope(section of the site) and whatever other data was in the custom table item.

Thanks!

0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.