Some categories not showing up

10 posts by 3 authors in: Forums > CMS Builder
Last Post: August 23, 2019   (RSS)

By CommonSenseDesign - July 18, 2019

Hi, there.

I'm using the following code on a page, and all of the categories show up on the live page, except "TCMH". Any why just one category would be hidden? There are several records that use that category label.

<p><a href="calendar.php">Show All</a></p>
<p><a href="calendar.php?category=TCMH">TCMH</a></p>
<p><a href="calendar.php?category=Aldaview">Aldaview</a></p>
<p><a href="calendar.php?category=Greenwood">Greenwood</a></p>
<p><a href="calendar.php?category=Nithview">Nithview</a></p>

Here's the live page:



category-02.jpg 19K

category-01.jpg 25K

By gregThomas - July 19, 2019

Hey Common Sense Design,

Here are a few common problems that could cause this issue:

  • There is a hidden character in the dropdown value (as displayed in category-02.jpg) such as an extra space.
  • There are no records in the database with the category TCMH, or the records that have the category are hidden.

If it isn't either of these issues, please could you raise a second level support request ( so that I can take a look at how the page is set up? I'll need the sites FTP and CMS login credentials.



Greg Thomas

PHP Programmer -

By CommonSenseDesign - July 19, 2019

Thanks, Greg. I'm sending you the details.

By CommonSenseDesign - August 15, 2019

Hi, Greg.

Thanks for the solution you sent me via email a while back.

Is there a way of solving this without having to add an image to each record? I know it works, but that seems a bit inelegant. If there isn't an easy fix, I certainly don't have a problem with passing your suggestion on to my client, though.


By CommonSenseDesign - August 20, 2019

Hi, Greg.

I've tried this on a duplicate page, but now there's an error message:

There are syntax errors on the highlighted lines of code, but I don't know what the errors are.

<div class="col-md-5">
<?php foreach ($calendarRecords as $record): ?>
<?php if(empty($record['upload])): ?>
<?php echo htmlencode($record['title']) ?>
<?php else: ?>
<?php foreach ($record['upload'] as $index => $upload): ?>
<?php echo $record['category:label'] ?>:
<a href="<?php echo htmlencode($upload['urlPath']) ?>" target="_blank">
<?php echo htmlencode($record['title']) ?>
<?php endforeach ?>
<?php endif; ?>
<?php endforeach ?>

By gregThomas - August 21, 2019


I've reviewed the code, but I can't see anything obviously wrong with the code on those lines. Please, could you find out what the exact errors are that appear and post them for me?

Greg Thomas

PHP Programmer -

By CommonSenseDesign - August 21, 2019

Hi, Greg.

I've attached a screengrab.




calendar0.php 13K

dreamweaver.jpg 111K

By Damon - August 21, 2019


On line 161 there is a missing single quote after upload.

Should be like this:

<?php if(empty($record['upload'])): ?>

Let me know if that fixes the error.

Damon Edis -

Hire me! Save time by getting our experts to help with your project.

By CommonSenseDesign - August 23, 2019

Hi, Damon. Thank you - I should have spotted that!

The error is gone, and everything seems to be working now as intended.

Thanks so much to you guys for your patience and help.