Multiple instances of a feature

This forum is only for questions or discussions about working with the mojoPortal source code in Visual Studio, obtaining the source code from the repository, developing custom features, etc. If your question is not along these lines this is not the right forum. Please try to post your question in the appropriate forum.

Please do not post questions about design, CSS, or skinning here. Use the Help With Skins Forum for those questions.

This forum is for discussing mojoPortal development

This forum is only for questions or discussions about working with the mojoPortal source code in Visual Studio, obtaining the source code from the repository, developing custom features, etc. If your question is not along these lines this is not the right forum. Please try to post your question in the appropriate forum.

You can monitor commits to the repository from this page. We also recommend developers to subscribe to email notifications in the developer forum as occasionally important things are announced.

Before posting questions here you might want to review the developer documentation.

Do not post questions about design, CSS, or skinning here. Use the Help With Skins Forum for those questions.
This thread is closed to new posts. You must sign in to post in the forums.
12/4/2009 6:20:35 AM
Gravatar
Total Posts 108

Multiple instances of a feature

Hi there.

Ive created custom features in mojo before, but never had to make multiple instances. So for example, i made a product section on a site before, but it just pointed to one table, so if i added a new instance it wouldnt show up a blank products section (hope that makese sense)

I'd like to make up a promos (as i call them). so i would create a user control as per normal

Could you give me some pointers as how i code them so i can insert multiple instances on a page, as i'd like to be able to use the same promo twice on a page, and be able to share across the site, so i guess it needs some kind of guid and to know where it is in the site.

below is an example of what the user would see when creating

http://timbutler.org/promo.gif

Many Thanks

Tim

12/4/2009 7:21:26 AM
Gravatar
Total Posts 18439

Re: Multiple instances of a feature

If you make your UserControl inherit from SiteModuleControl the you have intrinsic moduleId and ModuleGuid, you can store these in your custom table and use them to lookup instance specific content from your feature. ModuleGuid is like an alternate primary key. We join on moduleid for performance but moduleGuid is handy for things like if you want to integrate the ContentRating system in your feature, you can store ratings with your moduleguid and retrieve ratings with the same.  So it's best to store both moduleid and moduleguid in your custom table.

Study how existing features work will answer most questions about how to implement your own.

Hope it helps,

Joe

12/4/2009 7:47:00 AM
Gravatar
Total Posts 108

Re: Multiple instances of a feature

Great, thanks joe, shall look into it.

You must sign in to post in the forums. This thread is closed to new posts.