Improving workflow with Content Types

fabrikSometimes you might spend a lot of time creating a particular application (e.g. a helpdesk).  Wouldn't it be great if you could 'copy and paste' your Fabrik design to a different Fabrik installation.  This article describes how you can use this new feature of Fabrik 3.4, to move your Fabrik designs from one website to another using Content Types.

What is a Content Type?

When creating a new List in Fabrik, you are now invited to choose a Content Type.  This will automatically create not only the list, but groups, forms and elements, to a specific format.  Fabrik comes with a couple of default content types, but you can create your own, which is the subject of this article.


Initial Configuration

Before you start, make sure that your source application is setup exactly how you want it to be.  Particularly noteworthy is that the tables will keep the same name when migrating to a new database.  This is usually helpful, but beware when using Fabrik to access Joomla tables (e.g. the users table) and by default, Joomla tables have a unique prefix.


Creating the Content Type

Start by logging into the back-end of your source website.  We will need to first create the Content Type, and then download it.

  1. Go to Components > Fabrik > Forms.
  2. Select the Form that represents the core of your application.
  3. In the Content Type column, select the Down Arrow > Export.
  4. In the Content Type column, select the Down Arrow > Download.


Migrating the Content Type

You can now use the Content Type in the source website, but to use it in a different site, we must use a File manager to access the root files for the new website.

  1. Browse to /administrator/components/com_fabrik/models/content_types
  2. Upload the .zip file that you've just downloaded.
  3. Extract the .zip file.


Renaming a Content Type

Sometimes you may wish to rename a Content Type.

  1. Browse to /administrator/components/com_fabrik/models/content_types
  2. Open the file you wish to rename, for editing.
  3. On the 3rd line of the .xml file, change the name tag to your new name, and save the file.
  4. Rename the file to match the name tag that you've just changed.


Using the Content Type

Now that you've created a new Content Type on you new website, you can use it to create a new Fabrik application.

  1. Go to Components > Fabrik > Lists.
  2. Click the New button.
  3. Enter a Label.
  4. Select the Data tab, and enter a Table name.
  5. Click Save.
  6. Select your Content Type from the drop-down selection.

You will now be presented with an example of what your form will look like.  Be careful to consider which user groups will have access to your Form.  Click Save and close, when you are happy with your ACL settings.


Different Table Names

If your solution includes elements that were pointing to Joomla tables in the source database (e.g. abcd_users), these tables might not exist in the new database.  Make sure you edit all databasejoin elements to point to the correct table.


Thanks for visiting.