Site:Frontend:Modules

From Metrixstream
(Difference between revisions)
Jump to: navigation, search
Line 5: Line 5:
 
== Module Integration ==
 
== Module Integration ==
  
 +
=== Adding a Module to a Page ===
 
After a module is created or imported, it will be listed under Module Integration while editing a site page.
 
After a module is created or imported, it will be listed under Module Integration while editing a site page.
  
Line 18: Line 19:
 
   </html>
 
   </html>
  
== Accessing Module Pages ==
+
=== Accessing Module Pages ===
  
 
Since modules are injected into a parent page, pages within a module need to be called with the '''mpage''' URL parameter.
 
Since modules are injected into a parent page, pages within a module need to be called with the '''mpage''' URL parameter.
Line 25: Line 26:
  
 
   http://example.com/?page=auth&mpage=login
 
   http://example.com/?page=auth&mpage=login
 +
 +
=== Module Only ===
 +
 +
Some modules contain pages that serve up JSON or XML content and should ignore the included header and footer. This can be done by adding the URL parameter "output=moduleonly"
 +
 +
Example:
 +
  http://example.com/?page=auth&mpage=users.json&output=moduleonly

Revision as of 12:15, 15 June 2012

Contents

Introduction

Modules contain stand-alone code, files, pages, and page includes required to perform the tasks of the module.

Module Integration

Adding a Module to a Page

After a module is created or imported, it will be listed under Module Integration while editing a site page.

Selecting the module will populate MS.module.data with the contents of the module. Calling MS.module.data on the page will inject the contents onto the page.

 <html>
   <head>
     <title>Module Test</title>
   </head>
   <body>
     <?cs var:MS.module.data ?>
   </body>
 </html>

Accessing Module Pages

Since modules are injected into a parent page, pages within a module need to be called with the mpage URL parameter.

For example, if your parent page is "auth" and your module page is "login":

 http://example.com/?page=auth&mpage=login

Module Only

Some modules contain pages that serve up JSON or XML content and should ignore the included header and footer. This can be done by adding the URL parameter "output=moduleonly"

Example:

  http://example.com/?page=auth&mpage=users.json&output=moduleonly
Personal tools