Creating a Module Definition

Posted by Michael Assad on May 26, 2011
0 people like this tutorial
Rate:
  1. Log into Agility and click on "Settings"
  2. Under the “Customization” area, click on “Module Definitions”
  3. Click on “New Module Definition” at the top right of the grid
  4. Give the Module Definition a Name and a Description.  Note: The name and description of the module appear in the list of modules that is displayed when a user adds a module to a page.  It is important to use descriptive names and complete descriptions so that users know which module they are placing on a page
  5. Click on the "Properties" tab.  This is similar to the “Content Fields” tab in Content Definitions.  Properties can be used to influence how the content on the module is rendered
  6. Add some properties to the module.  Note: The “Linked Content” property type allows you to attach managed content to the Module.  When you add a Linked Content property, it asks you to pick a Content Definition which defines the structure of the content that you want to link.  If you select  “New Content”, each new Module created from this Module Definition will also create new content in the form of the Content Definition chosen above.  If you select “Shared Content”, the content manager can pick the Shared Content list to link to this Module.  When a new Module is created using this Module Definition, it will be linked to the specified Shared Content. 
  7. Click on the "Input Form" tab.  Similar to the Content Definition, the Input Form on the Module Definition is what content managers use to edit content and settings for the module.  You can use the system generated form or customize it.
  8. Click on the "Output Template" tab.
  9. For the output of the Module you can either use inline code directly in Agility or a User Control on the website.  For the User Control you must specify the relative path.  For example (~/Modules/Login.aspx).  For Inline code, start by clicking on the “Generate Default” button to create all the default code for the properties you added.  Note: We recommend generating the code to get a feel for the style, but it is easier to use User Controls for heavy development because it allows you to debug easier.  When you are done building your module, you can copy it back to the inline code in Agility.  Once inline, you to edit the Module in Agility directly without have to transfer code to your web server with each change.
  10. Click "Save and Close" to save your changes.

 

TIP: When adding fields, “title” and “textblob” field names are special names that are indexed.  Using these field names can increase performance when downloading and displaying the module.

 

Coding a Module Output Template as a User Control (ASCX)

  1. Add an ASCX file to the Modules folder of your website project
  2. Update the inheritance of the user control to extend Agility.Web.Controls.AgilityModule rather than System.Web.UI.UserControl.
  3. In Agility, configure your Module to use a User Control and specify the relative path.

Note: When you add the Module to a page, it will automatically load the User Control and pass it the Module Property values and any Linked Content.

 

Add the Module to a page

  1. Click on "Pages"
  2. Select a page from the sitemap on the left
  3. Click the "Add" button on one of the gray bars indicating a Module Zone
  4. Click on a Module name to pick it from the list
  5. Edit the properties and then Save and Close the module.
  6. Preview the page and the module will appear in the Module Zone you added it to.

 

 

 

Add a Comment

   
  
 
 
   
Submit

LOGIN

Log in with your Agility username and password or
register for the site




Log In

REGISTER












Register

FORGOT PASSWORD