Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7842877
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T16:25:21+00:00 2026-06-02T16:25:21+00:00

I created a conditional statement for my custom theme in Concrete5. My codes goal

  • 0

I created a conditional statement for my custom theme in Concrete5. My codes goal is to toggle layout. If the current page has a child pages under it, it will display an additional sidebar (<div class="grid_3">) to list the subpages items. If there’s no child page it would display a full layout (<div class="grid_13">).

Unfortunately I get a different result. there’s something I probably had missed on my condition statement. Instead of just display one layout, It is rendering the two layout.

Below is what my code look like:

<? if($c->getNumChildren()) { ?>


<div class="grid_3">
    <?php   
    $bt_sidenav = BlockType::getByHandle('autonav');
    $bt_sidenav->controller->orderBy = 'display_asc';
    $bt_sidenav->controller->displayPages = 'below';
    $bt_sidenav->controller->displaySubPages = 'all';
    $bt_sidenav->render('view');
    ?>
</div>

<div id="main-content-container" class="grid_10">
    <div id="main-content-inner">
        <?php
        $a = new Area('Main');
        $a->display($c);
        ?>          
    </div>  
</div>

<? } else { ?>

<div id="main-content-container" class="grid_13">
    <div id="main-content-inner">
        <?php
        $a = new Area('Main');
        $a->display($c);
        ?>          
    </div>  
</div>

<? } ?>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-02T16:25:22+00:00Added an answer on June 2, 2026 at 4:25 pm

    While your content generation portions of PHP use proper PHP tags (<?php … ?>), your if/else statements use short tags (<? … ?>) which are often disabled.

    Use <?php instead.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to create a conditional statement on my dynamic product pages on
How should I write the conditional statement for when I want to get all
I created a hierarchical custom post type called films. It is hierarchical so it
I have an excel file that has conditional formating set up to put a
For debugging environments, we have a conditional Debugger.Launch statement in the code to allow
Im trying to create a conditional statement that iterates through an array of nodes
Im looking to create a conditional within an in_array statement. Basically, I would like
--still learning rails here.. I want to write a conditional statement such as: if
I'm trying to implement a simple conditional statement in Handlebars that changes based on
I want to create dynamic conditional statement in java following are my expression in

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.