I am a web developer, born in PERU and now living in PDX. My platform of choice is CFML but I'm always open to learn anything. I currently work for Mentor Graphics.

I also do freelance web development and have a few open source projects that I maintain.

Where To Find Me:

Introducing the New HomePortals CMS Plugin

March 01, 2010

A few days ago I released the latest update to the HomePortals framework and its counterpart management platform ColdBricks. Besides the obligatory bug fixes and improvements, there was one new major feature on this release: the CMS Plugin. The CMS Plugin is a HomePortals extension to provide content management and site administration features to any HomePortals-based application without requiring the use of an external application (like ColdBricks) or building your own administration features.

At first glance it might seem that this functionality overlaps with ColdBricks, since ColdBricks has also content management features. In reality both projects, ColdBricks and the CMS Plugin, have two different and even complimentary goals. ColdBricks is a full blown platform that can be used to create and manage multiple sites and applications and can even be expanded with custom modules to handle additional administration tasks. This power and flexibility sometimes can seem a bit daunting if you only need to provide an easy and quick way of managing content and layout on a single site. And this is exactly what the CMS plugins aims for.

The CMS plugin is a super easy and quick way to instantly provide live authoring capabilities to any website that uses the HomePortals framework. The plugin provides and in-page interface layered on top of the existing webpage to allow the author to add and edit content, rearrange layout, add or remove pages and change layout templates; all without having to worry much about the internal details or configuration of the site.

Here are two screenshots of the same website, with and without the CMS Plugin activated:

From the previous screenshot you can see the main user interface. At first glance we can see controls to do several things on the page: add content, add more pages, edit page properties, view the site pages, etc. Also, the plugin detects all the regions on the page that can be used to place content and provides a quick and small handle bar to facilitate adding content to each region. All in all this type of interface may seem familiar to users with experience on most CMS products. However the difference here is that instead of building your site around a CMS, here you "inject" the CMS functionality into your site. This means that you have much more freedom in how you build and structure your application. Want ColdBox? no problem! Want Model-Glue? no problem! Want something quick and simple? you got it!

So how do you enable the plugin?

The plugin code is included in the latest version of HomePortals, so you only need to update to get it.

To activate the plugin you need to edit your homePortals-config.xml.cfm and add the following line to the < plugins / > section:

<plugin name="cms" path="homePortals.plugins.cms.plugin" />

If you are using ColdBricks, an easier way to activate the plugin is to just navigate to the site configuration page, select the "plugins" panel from the menu on the left and click on the "enable" radio button corresponding to the CMS plugin.

After you reinitialize your site to take in the configuration changes, you can access the CMS interface by appending "admin" to the url. So for example if your site is in a directory named "sample" then you would use your browser to go to:

The first time you invoke the plugin it will prompt you to create a user and password to access the authoring features. After you do so, you will be able to login and start editing your site.

All the authoring work is done on the same page without having to go elsewhere. Everything is done through dialog panels that are displayed below the main authoring bar. For example here is the dialog for editing a content module, showing a rich text editor:

As always any feedback and comments is greatly appreciated!

Enjoy


Posted on March 01, 2010      14 Comments

Related:
roger tobey's Gravatar roger tobey ...
This looks very nice - I needed something in between the full portal application of ColdBricks and the layout capabilities of HomePortals
March 02, 2010 10:24 PM
salvatore fusto's Gravatar salvatore fusto ...
I'm testing homePortals, expecially modelGlue intrgration; i've enabled the cms plugin but when i try to admin a site, after defining an enabled user, i get the error:
Message:
The HOMEPORTALS argument passed to the init function is not of type homePortals.components.homePortals.

Detail:
If the component name is specified as a type of this argument, its possible that a definition file for the component cannot be found or is not accessible.

Type: homePortals.components.homePortals

Tag Context:

C:\ColdFusion8\wwwroot\homePortals\plugins\cms\cms.cfc [line 32]
C:\ColdFusion8\wwwroot\homePortals\plugins\cms\gateway.cfm [line 34]
C:\ColdFusion8\wwwroot\hpModelGlue\cms-gateway.cfm [line 1]
How can i solve?
regards
April 12, 2010 10:48 AM
Oscar Arevalo's Gravatar Oscar Arevalo ...
Salvatore,
This problem occurs because the CMS plugin does not know where to find the HomePortals engine. Normally it assumes that it will be on a variable named application.homePortals, but since the ModelGlue integration manages the singleton differently (Using ColdSpring), then you get that error. The fix is very easy. If you look into your site folder, you will see a file named cms-gateway.cfm, which was created by the plugin. Edit that file and before the cfinclude tag, insert the following:

cfset homeportals_instance = application._modelGlue.getBean("homePortals")

I'm no ModelGlue expert, but the idea here is to get a reference to the HomePortals instance that was created by the bean factory. Probably there are cleaner ways to do so, but I think this should work.

Let me know how it goes!

Oscar
April 12, 2010 11:50 AM
salvatore fusto's Gravatar salvatore fusto ...
ok, now it works fine.
i like a lot this content managment approach, not invasive with the application.
another question: invoking an mg event-handler as a widget in a module, can i specify a parameter? i.e:
<widget event="widgets.info&param=value"...>
this would be great.
thanks and regards
salvatore.
PS
i'm not able to subscribe this blog, it seems as my email address i considered a spam, nor i receive the notification of subscribed comment.
April 12, 2010 12:04 PM
Oscar Arevalo's Gravatar Oscar Arevalo ...
Any attribute that you pass to the widget tag will be available to the called event as a parameter, just like if it were passed through URL or FORM scopes on a regular event call.

Example:
<widget event="widgets.info" name="oscar" otherattrib="42" ... />

I'll check on the email. We recently had some problems on this server, so things may still not working fine. I'll see if I can add you manually.
April 12, 2010 12:23 PM
salvatore fusto's Gravatar salvatore fusto ...
Oscar, another issue with cms plugin:
i'm playing ith your hpModelGlue sample: trying to manage site with the cms plugin, but if i try to add content in any region, i get:
Invalid CFML construct found on line 13 at column 109.
ColdFusion was looking at the following text:

[

The CFML compiler was processing:

* An expression that began on line 13, column 88.
The expression might be missing an ending #, for example, #expr instead of #expr#.
* The body of a cfoutput tag beginning on line 6, column 2.
* The body of a cfoutput tag beginning on line 6, column 2.
regards
salvatore
April 12, 2010 12:25 PM
Oscar Arevalo's Gravatar Oscar Arevalo ...
Which CFML engine and version are you using?
April 12, 2010 01:29 PM
salvatore fusto's Gravatar salvatore fusto ...
ADOBE CF8.
But i planned to have a try on railo express too: may be tomorrow i'll start.
regards
April 12, 2010 02:05 PM
Oscar Arevalo's Gravatar Oscar Arevalo ...
HomePortals requires at least Adobe ColdFusion 8.01 or Railo 3.1; If you have 8.0.0, then it could be that the error you see is due to the lack of support for struct literals.
April 12, 2010 02:59 PM
salvatore fusto's Gravatar salvatore fusto ...
version is 8,0,1,195765, as reported in admin >Server Settings > Settings Summary
April 13, 2010 02:57 AM
Oscar arevalo's Gravatar Oscar arevalo ...
So far for the easy fix... Can u post or email me a screenshot of the error?

Once we know exactly what part is breaking then it will be easier to fix
April 13, 2010 01:04 PM
salvatore fusto's Gravatar salvatore fusto ...
i need your email address; you can post it privately
April 13, 2010 01:29 PM
salvatore fusto's Gravatar salvatore fusto ...
sent 2 images: the former is before i try to insert content, the latter is the error i get when i click on button to insert.
ps
i can't receive the email for comment subscription.
April 13, 2010 01:51 PM
salvatore fusto's Gravatar salvatore fusto ...
Oscar, i just tested the same under railo express 3.1.2 and all works fine!
what do you think about?
regards
April 13, 2010 01:59 PM

All comments are moderated to prevent spam
Leave a comment