Templates in IP.Content are a useful tool that can save administrators a lot of work managing their site. They are utilized to facilitate displaying database content, and can be utilized to normalize the display of multiple pages through a shared template. We have made a few small tweaks to templates to make them easier to manage and easier to use in IP.Content 2.0.
Separation of templates
In IP.Content 1.x database templates and page templates were displayed on the same page. While they technically use the same backend system to render the templated HTML, it can be confusing for users to associate page templates and database templates on the same page. Utilizing containers can help separate the two types of templates, but we felt we should go a step further. In IP.Content 2.0, database templates and page templates are not displayed on the same page. Database templates now have their own page under the generic Templates header.
Container grouping
Within the template areas you can create containers to "contain" your templates. This is primarily used as a form of categorization and grouping, allowing you to group similar templates together. This is useful when viewing the templates on the template manager page, however templates are not similarly grouped when viewing them in dropdowns elsewhere throughout IP.Content.
We have enhanced the template dropdowns in IP.Content to display the appropriate template containers you have created in the dropdown menus, allowing you to more easily identify the templates you wish to use. The template containers are rendered as "optgroup" tags, so they will be unselectable (you won't be able to accidentally set a template container as your page template, for instance).
Developers may be interested to know that in implementing this change, we have enhanced the IP.Board admin CP output library formDropdown() method to accept an optional array of opt groups. You will be able to make use of this new optgroup functionality in your third party applications starting with IP.Board 3.1.
Identifier storage
Previously in IP.Content, we recorded whether a template was a database template or page template, however we never recorded what kind of database template you were saving (i.e. a "category" template, a "listing" template, or a "record display" template). Starting with 2.x, we now store what kind of database template you are creating, and in doing so we can better streamline IP.Content's options elsewhere.
When you create a database, only listing templates will be displayed in the listing template dropdown menu, for instance. This will help prevent users from accidentally setting a category display template as their listing template (in which case, no records are ever listed). Additionally, when clicking the link to display database variable help, we can now show you the variables directly related to the template you are editing, without having to ask you to select what kind of template it is first.
While this isn't an exciting change, for sure, we believe you'll find it streamlines management of your IP.Content installation, and makes your available options much clearer.
Template comparisons
We are introducing a template comparison tool for your database templates starting with IP.Content 2.0. When you upgrade to IP.Content 2.0, you will need to make template changes to take advantage of some of the newer features. For instance, to show the button to "watch" a record or category, the HTML for this button needs to be added to the template. It can be tedious and time consuming for you to have to manually create a new template and then copy over the customizations you have made to your previous template.
We have added a template comparison tool that will compare your database template to the default database template for that template type (i.e. to compare your database listing template to the default database listing template) so that you can quickly see what is different in your custom template compared to the default.
We believe this tool will help ease upgrades moving forward, especially upgrades where new features are introduced to the databases functionality in IP.Content.
Until next time...
We realize this isn't the most exciting blog entry about IP.Content 2, but we wanted to finish telling you about some of the smaller changes you should expect to see in IP.Content 2 before we get into the bigger things. Stay tuned for the next few blog entries. We think you'll like what we have in store!
Continue the conversation
Add your thoughts in our community