adding feature settings to one of my custom project's control

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.
1/20/2011 11:19:37 AM
Gravatar
Total Posts 17

adding feature settings to one of my custom project's control

Joe (and mojoWorld),

I am a little lost trying to figure out where (how) to implement feature settings for one of custom modules I have created in my custom project.  I added my new feature under Administration Menu > Advanced Tools > Feature Installation/Configuration.  The feature setting I added is an ISettingControl (dropdown) and created my custom dropdown user control and placed it in my custom project's [projectname]/Controls folder.  However when I debug and go to my feature settings page, it is looking for that dropdown user control in mojoPortal's root/Admin/.. folder and not in my projects folder.  Does my custom dropdown control need to reside under mojoPortal's domain?  Or is there a way I can keep this control separated in my project as well?  Maybe I missed something when setting up my custom projects.  Is there sample project out there or post that I can dissect my issue?

Thanks in advance.

Steve

1/20/2011 7:11:40 PM
Gravatar
Total Posts 17

Re: adding feature settings to one of my custom project's control

Can anyone help me?  I'm stuck.  Even a sample project out there would help.  Throw me a bone mojo.   The only way I can add feature settings to a custom module I wrote would be to include it in the mojo project, and not my own.  All the other custom modules I have written don't have any custom features, and work fine in my project.

Any help would be greatly appreciated.

1/20/2011 7:21:11 PM
Gravatar
Total Posts 1203
Proud member of the mojoPortal team

Help support mojoPortal!
Add-on modules

Re: adding feature settings to one of my custom project's control

Well, I'd help you if I could, but in my projects so far I've only been doing text field and check box feature instance settings as documented on the Module Settings document. I'd recommend finding a delivered feature that has a drop-down setting, and take a look at the corresponding mojoPortal code to see how that's implemented, and if it differs from how you have done it. Sorry I can't be of more assistance.

Jamie

1/21/2011 7:05:00 AM
Gravatar
Total Posts 18439

Re: adding feature settings to one of my custom project's control

Hi,

you need to make sure you are using a post build event to copy any controls needed by your feature up to a location in the main web project.

Generally for developing features that you plan to package for others to use, you should use the installation system to configure your feature settings via xml config files, that is what all the included features do. But you can configure them manually as you are trying to do, th emistake is how you specify the path for an ISettingControl. The path should be relative to the root of the mojoPortal.Web project (Web folder) like this:

~/yourfolder/yourcontrol.ascx

The post build event in your project should copy it to the location specified in the path.

Note that to run or debug your custom feature, you need to run it in the context of mojoPortal so mojoPortal.Web must always be the startup project. You can set break points in your custom project and they will still work, but you don't launch your project by itself you use post build events to copy your files up to the main web project and you run the main web project.

For example the Flickr feature uses an ISettingControl for the theme, the control lives in mojoPortal.Features.UI/Flickr/FlickrThemeSetting.ascx, the configuration file lives at mojoPortal.Features.UI/Setup/applications/flickrslideshow/FeatureDefinitions/70001_FlickrGalleryModule.config

Hope it helps,

Joe

1/21/2011 11:09:00 AM
Gravatar
Total Posts 17

Re: adding feature settings to one of my custom project's control

Thanks.  Got it.  Your saying to use the Flickr feature as an example:

mojoPortal.Features.UI/Flickr/FlickrThemeSetting.ascx, the configuration file lives at mojoPortal.Features.UI/Setup/applications/flickrslideshow/FeatureDefinitions/70001_FlickrGalleryModule.config

Let's say for my custom project, would I be able to retain everything in my project?

myCustomProj.UI/myFeature/myFeatureModule.ascx, the config file lives at myCustomProj.UI/Setup/applications/myFeatureFolder/FeatureDefinitions/10001_MyFeatureModule.config

AND... my biggest question...  where would my custom ISettingControl (dropdown) control reside?  In my project or in the mojoPortal.Web project?  I noticed that Admin/ModuleSettings.aspx is expediting this.

Thanks for helping me.

 

 

 

1/21/2011 12:06:40 PM
Gravatar
Total Posts 18439

Re: adding feature settings to one of my custom project's control

Yes, all your files should be in your own projects and those are the definitive copies of the files, but your post build event should copy the needed files up to the mojoPortal Web project and that is where they run from at runtime, if you make a change in your .ascx or .aspx file in your project you need to rebuild the project in order to copy it up again. You set breakpoints for debugging in your own project, it will still hit those break points even though the runtime copy is located up in the mojoPortal Web project.

You can study the post build event in mojoPortal.Features.UI or WebStore.UI

It is better to configure your feature settings aka module settings from a config file rather than from the web page UI. Your configuration files should live in your own project as well and should also be copied during post build up to the mojoPortal Web project at /Setup/[yourfeaturename]/ with sub folders structured the same way beneath that (basically conventions) You can see that is where the config files for features in the mojoPortal.Features.UI project live in that project but are copied by the post build events. Structure the folders in your project the same way so that when they are copied they land in the right places. Then visit the /Setup/Default.aspx page in the site and it will configure your default feature settings, run any sql scripts for your feature etc..

So the mojoPortal.Features set of projects as well as the WebStore projects are like examples of how to organize your own code, all the files for those features live in the feature specific projects, the needed files are copied up to mojoPortal.Web by post build events but are not part of the mojoPortal.Web project, but the run in the context of that project at runtime. Even though your files are not part of the mojoPortal.Web project, the files that get copied there (by the post build event) will be included if you Publish the mojoPortal.Web project, so you can produce a complete package with mojoPortal and your custom features.

Hope it helps,

Joe

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