Category Menu Code

6 posts by 3 authors in: Forums > CMS Builder
Last Post: November 12, 2010   (RSS)

I think I'm must be missing something that is right under my nose but can seem find it.

I trying to work with the Category Menu in the Section Editor. I have read this article http://www.interactivetools.com/forum/gforum.cgi?post=64259#64259 and several others.

When using the code generator for the Category Menu, should it be generating code as in the above article? I found another post that makes it sound like it should, but for me it is just giving the standard list or detail code.

I can use the code from the article above and get most of it to work, but it does not display or bold the selected item as I'm thinking it should.

Any help or suggestions would be appreciated.

Re: [pcolvin] Category Menu Code

Quick update. I have the code from the post working but cannot get it to identify the selected record.

I added a line to display the _isSelected but it never changes from zero.

<?php if ($categoryRecord['_isSelected']): ?><strong><?php endif; ?>
<a href="<?php echo $categoryRecord['_link'] ?>"><?php echo $categoryRecord['name'] ?></a>
<?php if ($categoryRecord['_isSelected']): ?></strong><?php endif; ?>
<?php echo $categoryRecord['_isSelected'] ?>


The value of _isSelected is showing up behind each link as it should. I just can't get the link that has been selected to show up as such.

Re: [pcolvin] Category Menu Code

By Chris - November 11, 2010

Hi pcolvin,

Can you View Source to see if your <strong> tags are being generated or not? It could be that the CSS for your A is overriding your STRONG — if so, you may need to put your STRONG inside your A, instead of the other way around.

If you're looking for more information on how to get started with Category Menus, check out my [url http://www.interactivetools.com/forum/gforum.cgi?post=77230]Sub-categories Tutorial[/url].

I hope this helps! Please let me know if you have any questions.
All the best,
Chris

Re: [pcolvin] Category Menu Code

Chris,

I found the problem. Of course after going through the tutorial again. [:)]

After commenting out the two lines in code to load the records, it began to work as it should.

<?php

require_once "cmsAdmin/lib/viewer_functions.php";

list($categoryRecords, $selectedCategory) = getCategories(array(
'tableName' => 'category',
// 'selectedCategoryNum' => '', // defaults to getNumberFromEndOfUrl()
// 'categoryFormat' => 'showall', // showall, onelevel, twolevel

));

?>


Do I need to worry about no having those two lines in the code?

Thanks again...

Re: [pcolvin] Category Menu Code

By Jason - November 12, 2010

Hi,

You won't need those two lines of code is everything else is working well.

Thanks
---------------------------------------------------
Jason Sauchuk - Project Manager
interactivetools.com

Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/