Skip to main content

CalcBuilder Tutorial

Calc Builder 6: publishing a calculator (menu item and module)

A calculator has to be attached to a menu item or a module to appear on the site. A menu item is required for a stand-alone page — opening the raw component URL without one causes a routing error.

Menu item

  1. Menus → [your menu] → Add New Menu Item, set the Title.
  2. Select the Menu Item TypeCalc Builder → Calc Builder.
  3. Choosing the Calc Builder menu item type

  4. Open the Options tab and choose your calculator in the Calculator field. (This step is essential — without it the page errors.)
  5. The Calc Builder menu item, type selected

  6. Optionally pick a result animation.
  7. Save & Close.

Module

  1. Content → Site Modules → New → CalcBuilder.
  2. The CalcBuilder module type

  3. Give it a Title, choose a template Position.
  4. In Calculator list pick the calculator to show.
  5. The CalcBuilder module settings

  6. Set Menu Assignment and Save & Close.

In the demo the Tip Calculator is published both as its own page and as a sidebar-right module on the home page.

A calculator running in a sidebar module

Module inside an article

A module does not have to sit in a template position — you can drop it into the body of any article (or custom HTML module) with a load-module tag. This is handy for a landing page that is mostly text with one calculator in the middle.

  1. Create the CalcBuilder module as above, pick the calculator, set Status to Published and leave Position empty. Note its numeric ID (shown in the module list).
  2. Make sure the Content – Load Modules plugin is enabled (SystemPlugins).
  3. Edit the article and type {loadmoduleid N} where the calculator should appear (N = the module ID). Use the Toggle editor / code view so the braces are not escaped.
  4. Save. The plugin swaps the tag for the module output when the page is viewed.
The Tip Calculator embedded in the body of an article via a single {loadmoduleid} tag.
The Tip Calculator embedded in the body of an article via a single {loadmoduleid} tag.

Prefer {loadmoduleid N} (by ID) over {loadposition xyz} for a one-off — it targets exactly that module and keeps working if you rename it.

...
Support/development

Perfect for small code changes or to correct any bug at your site

Buy now!
...
Support/development 40 hours

With the peace of mind of having a professional team at your service (20% discount)

Buy now!