Custom Context classes

John Smith asked on August 9, 2017 16:12

Hello,

I am having trouble finding documentation for building your own custom Context classes. Can anyone direct me to this sort of information?

Thank you,

Recent Answers


Trevor Fayas answered on August 9, 2017 16:21

Can you clarify what you mean by "Context class"?

If you mean a 'page' type of object that you can put on the tree and it has a Page Template, etc, then it's just the Custom Page Types,

if it's an actual database class for custom modules, you want to look at Custom Module Classes.

0 votesVote for this answer Mark as a Correct answer

John Smith answered on August 9, 2017 16:34

Hey Trevor,

Sorry about that. I meant Context classes such as SiteContext

Thank you,

0 votesVote for this answer Mark as a Correct answer

Trevor Fayas answered on August 9, 2017 17:35

Ahh, now i track you.

Well a Context class is just a normal Class that has Context specific information. Can you provide a little more details about what type of "Context" you are looking for?

For example, the MembershipContext is really just providing the UserInfo and other objects for the current user (which does a look up on their session / credentials i suppose).

You can extend Info and InfoProviders, but Context and Helpers are just classes Kentico provides to aid you, so you should just be able to create your own classes and use them.

0 votesVote for this answer Mark as a Correct answer

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