As we continue to review the code in the Beez2 template, we come across the following code:

// check modules
$showRightColumn        = ($this->countModules('position-3') or $this->countModules('position-6') or $this->countModules('position-8'));

  1. Based upon the name of the variable, showRightColumn, it appears the template is trying to figure out whether or not to show the right column of the template.
  2. Based upon the function called, countModules, it would appear that showRightColumn is going to be the value of how many modules are shown in each of the listed positions.

Before testing further, we will assume that if neither position-3, position-6, or position-8 have any modules being loaded, then showRightColumn will have a value of 0. Because it has a value of 0, the template would not show the right column.

What is the value of $showRightColumn?

At this point in our testing, we have:

  • 2 modules loaded in position-3
  • 1 module being loaded in position-6

When we make an adjustment to the template file to show the value of $showRightColumn, we see the value is 1. This means that showRightColumn is not the count of modules being shown, but whether any modules are shown in the list of positions. If there are no modules being loaded, then the value will be 0. Otherwise, the value will be 1 if there are any modules being loaded.

Our Testing Code The results

// check modules
$showRightColumn        = ($this->countModules('position-3') or $this->countModules('position-6') or $this->countModules('position-8'));
echo "showRightColumn = $showRightColumn"; die();

showrightcolumn-equals-1
Did you find this article helpful?

We value your feedback!

Why was this article not helpful? (Check all that apply)
The article is too difficult or too technical to follow.
There is a step or detail missing from the instructions.
The information is incorrect or out-of-date.
It does not resolve the question/problem I have.
How did you find this article?
Please tell us how we can improve this article:
Email Address
Name

new! - Enter your name and email address above and we will post your feedback in the comments on this page!

Like this Article?

Post a Comment

Name:
Email Address:
Phone Number:
Comment:
Submit

Please note: Your name and comment will be displayed, but we will not show your email address.

Need more Help?

Search

Ask the Community!

Get help with your questions from our community of like-minded hosting users and InMotion Hosting Staff.

Current Customers

Chat: Click to Chat Now E-mail: support@InMotionHosting.com
Call: 888-321-HOST (4678) Ticket: Submit a Support Ticket

Not a Customer?

Get web hosting from a company that is here to help. Sign up today!