Need Feature Module template (or simple example)

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.
5/30/2011 5:09:24 PM
Gravatar
Total Posts 19

Need Feature Module template (or simple example)

I'd like to implement JW Player as an insertable feature for playing videos.

Does anyone have a simple feature module project they can share? Anything that somewhat works would help me get a start.

Otherwise, I have downloaded the source code and will probably attempt to clone the Contact Form and modify it.

Thanks!

kevin@tek4.com

5/31/2011 8:18:42 AM
Gravatar
Total Posts 18439

Re: Need Feature Module template (or simple example)

Starting with our Hello World example code is the easiest way to make a simple module. It doesn't even require a separate project, you just drop in the file and install it from the UI. For more complex features I would use a project and code behind instead of inline code, but for very simple things the inline code approach makes it very easy.

Hope that helps,

Joe

6/1/2011 6:05:50 PM
Gravatar
Total Posts 19

Re: Need Feature Module template (or simple example)

Okay, got the source and planning to build a full-fledged Feature... I want to have settings for each instance of JW Player (video, size, playback, etc.)...

QUESTION:

In the FeatureDefinitions folder, what is the "30000" in 30000_ContactFormModule.config? I noticed each feature has a different number here, and a couple features have no number. What should I use for my Feature?

6/1/2011 6:27:20 PM
Gravatar
Total Posts 1203
Proud member of the mojoPortal team

Help support mojoPortal!
Add-on modules

Re: Need Feature Module template (or simple example)

I'm not sure why those files are named with a number prefix, but I can tell you that the number is not required (my custom features' installation config files are not named that way). The only number that really matters is the "sortOrder" parameter inside the config file. That value determines where your feature will appear in the features drop-down. I've been using "9999" for that, so all of our custom features appear at the bottom of the list in alphabetical order.

Jamie

6/1/2011 9:13:15 PM
Gravatar
Total Posts 19

Re: Need Feature Module template (or simple example)

Thanks, Jamie. It's somewhat apparent that the number isn't required, but I want to conform to mojo customs.

There are also numbers under the SchemaUpgradeScripts (i.e., "0.0.0.2.config") -- obviously SQL scripts that execute with Feature upgrades -- so I think I understand that one.

I'm trying to get an understanding of all the files I'm going to need to write to put together a Feature.

Kevin

6/2/2011 5:31:49 AM
Gravatar
Total Posts 18439

Re: Need Feature Module template (or simple example)

In the case of the sql scripts the versioned file names are very important, once it runs a script of a particular version it will never run that script or any lower version again for the feature.

The number prefixes on the feature definition files are not important, at one time in the past that did control the sort order of features in the dropdown list, but it was later changed to use the SortOrder as Jamie mentioned.

Hope that helps,

Joe

6/2/2011 7:05:48 AM
Gravatar
Total Posts 19

Re: Need Feature Module template (or simple example)

Yes, that does help! The SQL script versioning is fairly obvious and I guessed that one.

Hoping to report some initial success here soon...

:)

6/6/2011 4:41:10 PM
Gravatar
Total Posts 19

Re: Need Feature Module template (or simple example)

OKAY! After starting to get friendly with the mP source code... I realized I don't need a Feature plug-in.

I realized in order to add videos using JW Player to a page all I need is a CKeditor plug-in to generate an HTML template and present a "Browse..." button for selecting a video from the uploaded files. For the interim I can use a simple HTML template and manually type in the video URL.

Never fear, developers, as CKeditor plugins look to be equally challenging to unravel and conquer...

6/6/2011 5:27:09 PM
Gravatar
Total Posts 1203
Proud member of the mojoPortal team

Help support mojoPortal!
Add-on modules

Re: Need Feature Module template (or simple example)

If you just need to give your users an easy way to quickly enter a block of complex HTML in the editor, you should check out mojoPortal's built-in Content Template system. I guarantee that will be easier to set up and than whatever CKEditor wants you to do. laugh You may need to do a little bit of end-user training as far as the video uploading portion goes, since Content Templates aren't programmatic, but you can have a big "Insert Video Here" message in your template.

Jamie

6/6/2011 5:51:43 PM
Gravatar
Total Posts 19

Re: Need Feature Module template (or simple example)

Thanks Jamie. Indeed, I am using a Content Template in the interim. However, it is not sufficient. One needs to manually construct a URL for the video source file to replace the "Insert Video Here" slug.

Ever use the insert image or Flash button in CKeditor? CKeditor brings up a dialog where you can set parameters and click a "Browse..." button to locate your target file. It is essentially a Content Template on steroids.

A JW Player plugin for CKeditor would insert the required HTML like a Content Template, but would provide a dialog for easy editing of parameters and, most importantly, the Browse button to navigate the file system and select a source file.

It shouldn't be too difficult to modify the Image or Flash plugin (famous last words) to provide a "smart Content Template"!

6/6/2011 6:04:33 PM
Gravatar
Total Posts 1203
Proud member of the mojoPortal team

Help support mojoPortal!
Add-on modules

Re: Need Feature Module template (or simple example)

Okay, I see the difference now. If you get it working, I'd be interested to see the solution!

Jamie

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