Blocks (Includes)

My Market Toolkit was built to support a concept called DRY - "Don't Repeat Yourself". A website can be built so that if it needs to be altered, it can be modified in one place to affect the rest of the website where applicable.

An include block is a very helpful CMS concept. It allows web designers to build CMS templates and include HTML modules as needed. There are several different types of includes and each has specific function.

Site managers can turn certain parts of the template on or off from page to page as needed. We can also have multiple templates all using the same modules so that when a designer updates the template, he/she does it in only one place, saving significant time.

An include is created so a designer simply drags the module into the template and that specific HTML is available throughout the website from page to page as needed.

Include Modules - Types and Formats

There are numerous include types. Each has a specific function. 

Include Type Description Example Uses
Master Block

Shows on all pages within a template.

A Master Block is used in templates. It is basically an include section. It can be added to any template within a site in an account.

Create a page header that should show on all pages. Add a logo, social icons, navigation menu, etc. Add the header include to multiple templates. Later, if you upload the header include it will be updated.
Global

Shows on all pages within a template. Available to all sites in an account.

A global include block is a master block available to more than one site within an account.

 

Perhaps you want to use the same footer across a main site and a support site.
Site

Shows on all pages within a template. Available to only one site in an account.

A site include block is a Master Block whish is only available for a specific site, whereas the global include is available for any site in the account. 

 

Create a header. Add a logo, social icons, navigation menu, etc. Add the header include to multiple templates. Later, if you upload the header include it will be updated.
Module

Only shows on specific pages as chosen when editing the page.

A Module include is an optional include block. It is like a Master Block but the user can choose which pages it displays on. When a user manages a web page a list of Module Includes shows under the heading of "Optional Includes" with check boxes. Checking the box next to the desired module will automatically add it to the page in the location it was inserted into the template.

You may have 3 different menus on the side navigation. The contibutor can choose which menu shows on each page.
Field

Provides an extra field when editing content on a page. Allows user to update multiple locations in a template.

Some websites provide content in multiple sections of each page. As a rule of thumb, it's not a good idea to include layout elements within the content in case the website template is to change in the future. With a Field include you can add the field to the template and a new content field shows on every page.

Note: The Field include content is not edited in the module, but on each web page.

You may have a main content area and sub content area for each page.
Toggle

Allows content to show/not show depending on whether a user is signed in to view a site.

A Toggle include is used when some system event occurs that may need to display one of 2 results.

There are multiple Toggle includes:

  • Flash Notices
  • Logged In / Logged Out
Show a menu if the user is signed in. Don't show it if they are signed out.
Component

Shows if the page is in the matching volume.

A Component include is displayed based on what type of page is being loaded such as a webpage, blog post, ecommerce product, or an external application. This is helpful for when you want to simplify the number of templates you're using, but have some slight variations between the different areas of the website.

You're using the same template for products and product categories. The only difference is one displays a list while the other displays all the details for a product.  Create 2 component KBlocks and then add the appropriate KMods to each, and then add both of these KBlocks to the template.

Inclue Modules allow for tremendous flexibility. A website may have almost any layout and structure to provide key content or functionality.

Using Includes

To use an Include Module do the following:

  1. Hover over "Design"
  2. Click "Modules"
  3. Click the "New" icon
  4. Chose the appropriate Include and follow the onscreen instructions
  5. Save the Include
  6. Edit the template where the include should go (you may need to refresh the page if you added a new module while the template editor is open)
  7. Drag/drop the module into the template.