Module

Overview

A module is best described as being a piece of reusable code that displays small sections of information. Within the platform the module wrapper structure will remain the same. The visuals of this wrapper may be drastically altered by utilizing additional class names, styling per module, column or even page section. The presentation to the right shows a general module.

Anatomy of a Module

The default structure of a module consists of many wrappers. These allow for a wide assortment of visuals to be applied. The inner contents of each module are different but the outer wrapper for every module consists of:

  • header
    • module title
    • more link
  • footer
    • more link

These links are not required and may be displayed or not based on the module settings selected for that page layout in the control panel.

Common Elements

Each module on the network has settings that apply directly to it. For example, you can pick and choose which network statistics you want to display in the Network Vitals module, but that would not be relevant to the Photo module. Beyond those module specific options is another set. These options are common between almost all modules.

  • Hide if Empty – This option allows networks to include all modules on a page they wish to display without the worry that a module will appear broken or empty if no results are found. For example, the photo module may be added to the user profile page, but until the user uploads photos the module will not display.
    • Yes (default)
    • No
  • Tier – This option allows networks utilizing the tier system to filter contents of a module based on a particular tier of users. For example, a site might wish to display a blog module but have the posts displayed be those writtenThis option allows networks utilizing the content categories feature to filter the contents of a module based on a particular category.
  • Show More Link – Most modules on the platform offer the ability to display a link to more of the same type of content displayed elsewhere on the site. There are three ways this link may be displayed.
    • None (default)
    • All
    • Top Link
    • Bottom Link
  • More Link URL – This option is used in conjunction with the above Show More Link option. When enabled the previous option is enabled, this option can be modified to change where the more link points. This option will default to the standard location for each module’s content type.
  • Style – This is a deprecated feature. This option is not compatible with ONEsite’s newest page layout system and has been replaced with the CSS Classes option. Networks still utilizing the old layout system may use the style option to assign custom class names which can then be used to style modules individually.
  • User Dragable – This option is part of the User Drag and Drop system. When this feature is enabled, all modules set to dragable on the template will be able to have their placement adjusted on the page.
    • Yes (default)
    • No
    • With Column
  • Visible When – This option allows the network operator to present different views of a page based on who is viewing it. By default, this option makes all modules visible to everyone. However it is possible to make certain modules display only when a user is logged out, or only if the user is the owner of the page, etc.
    • Always (default)
    • Logged In
    • Logged Out
    • Blog Owner
  • Hidden By Default – TThis option is part of the User Drag and Drop system. On pages where this is enabled, this option can be set to include extra modules that users can add to a page that are not normally displayed.
    • No (default)
    • Yes
  • User Can Add/Remove – This option is part of the User Drag and Drop system. On pages where this is enabled, users will be able to move and potentially remove modules from a page if you set this option to yes.
    • Yes
    • No (default)
  • Seconds to Cache – ONEsite highly recommends networks take advantage of this option to set cache times for individual modules on your pages. By caching modules that don’t change often, you can greatly increase the speed of your page loads.
  • CSS Classes – Often, a network will find the need of having more than one of the same module available on a page. For example a blog module displaying posts made by staff members and another blog module displaying recent posts. CSS Classes allows a network operator the ability to create custom names for a module which can then be used to style that module separately. Each CSS Class name must be one word only (though you may use underscores or camelCase). Separate multiple CSS Class names with a space.
  • Hide Module Wrapper – The module wrapper includes the module header, footer, and a wrapper around the body contents of the module. Setting this to Yes will remove each of these elements. This is most often used with the Custom HTML module.
    • No (default)
    • Yes