Creating a custom module

Apr 26, 2014 4:49 pm

In Freedom, you can build custom modules for the end-user that can collect and display data in nearly limitless ways. You can determine what information is collected in the Blue Interface, and determine how that information displays on the live site with full control over the HTML. Custom modules are also used to build directories of products that can work with the Commerce Module, allowing you to sell products online.

Creating a custom module

  1. Go to the Toolbar Module of the Green Interface.
  2. Click the Add a new Custom Module button.
  3. Select a template from the list.
  4. In the Unique ID field, enter a name for the module, which will be used internally by the system.
  5. In the Toolbar Title field, give the module a name. This name will appear in the Blue Interface.
  6. If you want the module to appear in the Blue Interface, set the Blue option to "On."
  7. Click the Add new Custom Module button. The new module will be created.

Setting up the new custom module

  1. In the Toolbar module, the new module should now appear in the list of modules. Click Edit next to its name.
  2. A screen will appear that has four subtabs: Configuration, Fields, Lookups and Categories. On the Configuration tab you can control the module's settings. To make the custom directory a product catalog that works with Commerce, check the Enable E-commerce option. Once you've finished with the configuration settings, click Apply.
  3. Switch to the Fields subtab. This is where you can add fields to the directory which collect data in Blue. Depending on what template you selected when creating the directory, certain fields will already appear here.
  4. To add a new field, click the Add a new Field button. A popup window will appear with a list of options for the new field.
  5. Select a Field Type. Index fields are used for setting up tags, which make them easier for users to locate. For normal fields that don't require this functionality, it's recommended that you use predefined rather than custom fields, because you can:
    a. Use them to set up searches
    b. Display them as columns in Blue
    c. Sort or filter module layouts by them
  6. However, if your custom module will have more than ten fields, you may have to use custom fields for those fields that won't be used for searching, sorting or filtering.
  7. For Unique ID, select an option from the list (in the case of Predefined or Index fields) or enter one (in the case of Custom fields). The unique ID is how the field will be referenced within the system.
  8. For Label, enter a title for the field that will appear in the Blue Interface.
  9. For Input Type, determine how Blue users will enter information into the field. The options below Input Type will change, depending on which type you selected.
  10. The Blue HTML field determines how the field will appear in the Blue Interface. The default option is [[input_row]], which displays the label and field as two columns in a table row. If you replace the default, make sure to enter a two-column table row.
  11. The White HTML field is similar to the field above, but it determines how the field displays when members add directory items from MyAccount. This functionality is set up using using the Membership Module.
  12. If you'd like for the field to have a small question mark next to it that users can click for information, enter text into the Help Text field. This can explain the purpose of the field to Blue users.
  13. Click OK. The new field will be created.
  14. Add additional fields as needed. To test the new module, view it in the Blue Interface.

Setting up module layouts
Module layouts let you control exactly how information from the directory will display on the live website. Information from each field can be displayed however you want by using tags from the Insert a tag icon in the toolbar. Each field added to the directory will appear in this list. For a basic understanding of how module layouts work, see Introduction to module layouts.