Basic Feature development questions...

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.
3/28/2015 7:01:46 PM
Gravatar
Total Posts 32

Re: Basic Feature development questions...

I can clarify #3 a bit more now that I have woken up some. :)

Can a Feature project have more than one UserControl (SiteModuleControl) in a project? Yes, I realize that each control would be treated as a separate module - that's the intention. And could I specify feature.config files for each that contain module settings?

3/30/2015 8:51:51 AM
Gravatar
Total Posts 18439

Re: Basic Feature development questions...

1. from a page or usercontrol one can resolve urls relative to the application root using Page.ResolveUrl("~/your-relative-path");

If you are using multiple sites based on folder names then the first folder segment may be virtual to represent the site. In that case we have built in SiteUtils.GetNavigationSiteRoot();

also if inheriting from mojoBasePage or SiteModuleControl there are built in properties for SiteRoot and ImageSiteRoot which would both be the same except when using folder multi sites in which case SiteRoot would include the virtual folder segment, similar to SiteUtils.GetNavigationSiteRoot()

3. as with most questions you can study the existing source code to learn from examples of how we did things. the mojoPortal.Features.* set of projects contains many features (many SiteModules and many supporting pages for different features including blog, forums, etc, etc) in the same projects, whereas the WebStore set of projects represents only one feature

3/30/2015 4:29:07 PM
Gravatar
Total Posts 32

Re: Basic Feature development questions...

Hello Joe!

1. Thanks so much for this. These are exactly what I was looking for.

2. This is still an outstanding question. I actually have something more specific to it tho - I need to develop (or actually migrate) my own Blog module/feature in Mojo. There's already a folder named "Blog" in the project/site, so I was thinking I could simply move this and my other modules (the front end files) into their own folder - in this case "/MyModules/Blog". Obviously I would do this prior to installing the module in Mojo's DB. Assuming I reference the file/folder location in the module settings properly is this a valid way to do this?

3. Yes, I poked around more and figured out how a lot of this works. I do have one more question tho, and I couldn't get as clear answer while looking or reading the documentation... There seems to be only one SiteModuleControl(ascx file) per folder. Is there any particular reason why there can't be more than one in the same folder? Yes, I am aware that the Mojo system will treat each ASCX file as a separate module/feature. I just need to know if I can put this toolkit of connected features together, or at least need separate folders in the same project for each component.

3/31/2015 9:31:09 AM
Gravatar
Total Posts 18439

Re: Basic Feature development questions...

How you organize your own files is pretty much up to you in that we don't have any constraints on it, other than you should avoid clashes with existing files.

For features that consist of only a .ascx module control, I see no problem with having multiple feature modules in the same folder.

For features that have supporting pages I generally put the feature in its own folder to keep the module and the supporting pages organized. But this is not a hard rule, you can make your own decisions.

If you have a custom feature that is a replacement for an existing feature I would try to use a synonym to avoid folder name clashes. A custom blog for example I might call it news instead and put it in a folder named "news" since there is an existing feature using a folder named "blog".

3/31/2015 11:01:40 AM
Gravatar
Total Posts 32

Re: Basic Feature development questions...

So, if I understand this correctly...

Each Module(ASCX) gets its own setting file(config). The setup routine actually polls the config files, and installs the ASCX files from that information - and the location of the files is irrelevant as long as they are properly referenced. Right?

I decided to just go with a prefix in front of my "blog" module. :)

3/31/2015 11:18:16 AM
Gravatar
Total Posts 18439

Re: Basic Feature development questions...

that is correct

3/31/2015 11:45:19 AM
Gravatar
Total Posts 32

Re: Basic Feature development questions...

And it doesn't matter how many config files are in the FeatureDefinitions folder as long as they are distinct and point to the separate ASCX files?

3/31/2015 11:52:44 AM
Gravatar
Total Posts 18439

Re: Basic Feature development questions...

that is also correct

4/21/2015 12:01:00 PM
Gravatar
Total Posts 32

Re: Basic Feature development questions...

Thanks for all the help so far. I am busy migrating over our company's code and products to Mojo and it's going fairly well. 

New issue - so to speak...
I am trying to get an image directory from ImageSiteRoot and/or SiteUtils.GetImageSiteRoot() and it's coming up blank. I traced the code and it seems there's some confusion as to what's supposed to happen. Can you shed some light on the behavior of this function/property?

Thanks!

4/21/2015 1:19:21 PM
Gravatar
Total Posts 18439

Re: Basic Feature development questions...

I suggest just use

Page.ResolveUrl("~/path/to/yourimage.png");

where ~/ represents the root of the web app

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