mojoPortal Tip: Creating Custom Content Templates
Written by Carole Bennett Sunday, 4 September 2011
The modular feature you will use most frequently in most mojoPortal installations is the HTML Content feature. With the assistance of creative CSS classes, leveraging typography from sites like Font Squirrel, you can create some very impressive content within the HTML feature. There will be times you would like to be able to create a specific look “on the fly”, without having to manually create the layout and paste it into the feature. This is where custom content templates come in handy.
A pre-requisite to using content templates is that your content authors have a basic understanding of how to use HTML-based content. (Note – copying directly from Word or Libre Office documents is not recommended for this.)
We will start by navigating to the Content Templates section in the Site Administration.
You will click on this link, then on “New Template”. You will see a familiar edit screen, like this:
I have given this a name of “Demo Template”; I have found that it is easier to edit using the “Source” view. In HTML view, the same code will look like this:
This is very much like the same view your users will see when they use this template, so if it does not make sense here, it will not be usable for them, either. Once you are comfortable with the template layout, click “Save”.
We will go back to one of the pages that we are working on content to see the results. Click on “Edit” on an existing HTML Content instance:
After clicking the icon indicated by the arrow above, you will see a pop-out with a selection of pre-formatted templates that ship with mojoPortal, as well as the new template we have just saved. Click on the selection, and you will see your template content appear.
The quickest way to edit the content is to highlight the existing entries, and type in your desired content. Hit “Update”, and here is your result:
You can also leverage custom CSS classes to create unique and interesting layouts within your templates. Using a CMS does not mean that your presentation has to be boring or limited; with the tools available, and a bit of skill, you can create a great site that is still easy to maintain.