CMS Support - KBlocks

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.

A KBlock is a very helpful CMS concept. It provides the opportunities for web designers to build CMS templates and include HTML modules as needed. There are several different types of KBlocks and each has specific function.

Here's a brief example: take note of this web site. Note how most of the pages look the same? There is one template applied to every page. However, the 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.

A KBlock is created within the My Market Toolkit CMS tool. Once it is created, a designer simply inserts that line into the template and that specific HTML is available throughout the website from page to page as needed.

KBlock Types and Formats

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

KBlock Type Description Example KBlock Code
Global

A global KBlock is placed in a template. It shows on all pages using that template.

Example - You might have a main menu that should show on every page.

[kblock type="global" name="nav-main"]
Module

A Module KBlock is an optional KBlock. When a site contributor adds a new page, the page lists the available modules at the bottom 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.

Example - You may have 3 different menus on the side navigation. The contibutor can choose which menu fits each page.

[kblock type="module" name="menu-left-main"]
Toggle

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

Example - The system allows for a "flash notice" like "Your comment was saved" among other notices. A designer is able to place the KBlock anywhere within a template.

There are multiple Toggle KBlocks:

  • Flash Notices
  • Logged In / Logged Out
[kblock type="toggle" name="site-notices"]
Component

A Component KBlock 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.

Example - 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.

[kblock type="component" name="ecom-products"]
Site

The site KBlock is the same as the global KBlock, except that it is only available for a specific site, whereas the global KBlock is available for any site in the account. 

Example - You have content that is specific to one site, but not the others. It will still work if it's a global, but it will clutter up your KBlock page on all the sites that don't need it. 

[kblock type="site" name="customer-survey"]
Field

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 KBlock you can add the field to the template and a new content field shows on every page.

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

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

[kblock type="field" name="sub-content-area"]
Role

If you need to show different content based on what role your visitor belongs to, use the Role KBlock.  If it's simply a matter of whether or not somebody is logged in, use the Toggle KBlock instead.

Example - You have 2 roles:  one for customers and one for sales people, who have access to different pages in your website. Build a menu KMod for each role and place them into separate Role KBlocks.

[kblock type="role" name="customer-menu"]

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

Using KBlocks

To use a KBlock do the following:

  1. On the "Market Place Tools" menu, hover over "Web Content Management" and click on "Manage KBlocks".
  2. Click "Create a KBlock.
  3. Give it a meaningful Title and Description. The KBlock "Name" Parameter field will auto generate unless you specify a parameter name.
  4. Select the KBlock Type
  5. Fill out the appropriate content fields.
  6. Save the KBlock
  7. On the "Manage KBlocks" screen, click the Edit (pencil) icon for the new KBlock. A new Template Code is provided (e.g. [kblock type="global" name="nav-main"]). Copy it and paste it into the desired Template.