New FormBuilder Module and Widget

Guys,

I just released an Alpha of a module/widget combination for ContentBox that can be used to create forms and display them within your ContentBox content.

The FormBuilder Module, used in combination with the FormBuilder Widget will allow you to create forms and display them on your ContentBox pages. Both the ContentBox FormBuilder Module and ContentBox FormBuilder Widget are required for forms to be rendered. Forms are rendered with the following syntax.

{{{FormBuilder:slug=‘slug-of-the-form’}}}

Alternately, you can just use the “Insert a ContentBox Widget” icon from the ckEditor in ContentBox to deploy a form build with the FormBuilder Module to a page.

Forms are built from the Form Builder menu item on the ContentBox Modules screen that will be available after the FormBuilder Module is activated.

Feel free to contribute. Right now we support Text, Text Area, Select, CheckBox, Radio, and CheckBox Group for form field types.

You can download both from ForgeBox

ContentBox-FormBuilder-Widget

ContentBox-FormBuilder-Module

Or you can view them on GitHub

https://github.com/gratzc/cbwidget-formbuilder

https://github.com/gratzc/cbmodule-formbuilder

Let me know if you have questions, or fork it and do any updates. Still quite a lot I would like to do with this, but wanted to get it out there.

Curt Gratz
Computer Know How

Any reason the widget is not part of the module?

I wanted to take advantage of being able to deploy the form to a page using Luis’s enhancements to ckEditor.

Curt

You can do that, a module is just a module that goes by the routes you set up for it. By default the module route is public accessible from the front end, this has been discussed by me in this forums on number of posts in here.

Especially with the likes of securing the module routes.

Also I have 5 modules I am working on at the moment that do the same thing, has front end display options and Admin configuration screens / options only viewable in the Admin section.

I am sure I also wrote a blog on this as well.

I’d be interested to see how you would do it without the Widget? And let the user enter the slug of the content they want to display, etc.

I am BTW, using the module to create the HTML, etc. Basically the widget just is designed to collect the information about the deployment of the form and then it passes it along to the Module, which in turn returns the rendered form to the Widget which will display it on the page.

Good blog posts around the interception points you had in the past though and using them to insert content into a post or page. Keep it up.

Curt

You still use widgets, you can create widgets in modules as well. Which is why I asked why you did not put the widget in the module, I was thinking that there might have been another reason that I was not aware.

And thanks for the praise.

Interesting, the widgets are read off of a directory listing of the widgets path, so how would you register them in ContentBox if they are in the module?

Curt

In your module create a plugins folder, inside that create your widget folder.

Remember widgets are just plugins.

Ok Curt you are right I was going through the code that I used, I forgot as it has been awhile since I set this up.

I actually use my own interceptor to do a translateContent, that use a better widgetService to get the widget. Although I do the same for layouts by creating the widget directory I did find that the same could not be said for modules.

The way I got around this was crude, because I would have suspected that a widgets folder in plugins to be sufficient. Alas it was not, so I wrote my interceptor to do my own translateContent for module widgets to do the same thing that widgetService did.

Maybe Luis, can make these changes when he gets around to it. I have made so many changes to ContentBox to get around problems like this I forget that it is not the original way it works.

True, I do know that, however they get picked up by ContentBox in a special way. Unless I am missing something, if you don’t place them in the /contentbox-ui/plugins/widgets folder they won’t get registered in the system.

Curt

No worries, I may just keep refactor, and keep it in the module as you suggested, then have the module move it to the plugins/widgets directory on startup if it’s not already there.

Curt

That’s an interesting approach, using the onLoad on Unload to do that… Never thought of that either.

Well, I didn’t either until you thought it was odd that I had a module and a widget.

Go collaboration.

Thanks,
Curt

lol…

Yeah I was looking at the widgetService again, you could even utilise that to do most of your copying as well. The only downside is you would need to create it as a txt file in the templates folder then call the createWidget. Might be a pain to move back and forth during development though.

So what would be the ideal solution?

Should modules have widgets as well?
Should they just be dropped in the plugins folder and all the plugins would be available as widgets?
Should there be a new convention called “widgets”

Ideas?

Luis F. Majano
CEO
Ortus Solutions, Corp
www.ortussolutions.com

ColdBox Platform: http://www.coldbox.org
Linked In: http://www.linkedin.com/pub/3/731/483
Blog: http://www.luismajano.com
IECFUG Manager: http://www.iecfug.com

Social: twitter.com/lmajano facebook.com/lmajano

Your asking us? That vacation make you soft?

LOL,

I am still in vacation mode my friend. However, in the way back I closed over 10 ContentBox features, so maybe I am just hiding all the work that’s coming! :slight_smile:

Luis F. Majano
CEO
Ortus Solutions, Corp
www.ortussolutions.com

ColdBox Platform: http://www.coldbox.org
Linked In: http://www.linkedin.com/pub/3/731/483
Blog: http://www.luismajano.com
IECFUG Manager: http://www.iecfug.com

Social: twitter.com/lmajano facebook.com/lmajano

That is the Luis we know and love!

Good question Luis, my answer would be yes but after thinking it about some more, probably not.

Maybe the installation can be a bit smarter, and be able to package everything together and know how and where to install things too, as well as uninstall.

I modified ContentBox to allow for widgets in modules, but ran into many other issues. I am a strong advocate to keep things together, but maybe having widgets installed all over is not the right answer.