Just not understanding how to set up Category menus

44 posts by 5 authors in: Forums > CMS Builder
Last Post: September 22, 2009   (RSS)

By Codee - September 7, 2009

Chris, no problem BUT in the meantime I have a BURNING question -
I've been testing viewers with pulling the inventory data and display the list and details records. When I pull the manufacturer or model I get the record number for them instead of the actual name. Here's the code I'm using...and except for the if statement all the code on the page was generated by the code generator:
Here's the year, make, model code:
<?php if ($record['year']): ?>
<b/><?php echo $record['year'] ?>&nbsp;</b/>
<?php endif ?>

<?php if ($record['manufacturer']): ?>
<b/><?php echo $record['manufacturer'] ?>&nbsp;</b/>
<?php endif ?>

<?php if ($record['model']): ?>
<b/><?php echo $record['model'] ?></b/><br/><br/>
<?php endif ?>

Only the year comes up with the proper name...the manufacturer and model come up with their numeric record equivalents and I would like the name/title of the manufacturer and model to appear.

Thanks,

Re: [equinox69] Just not understanding how to set up Category menus

By Chris - September 7, 2009

Hi Terry,

What a coincidence! I've been working on a generic solution to both of these issues. I hope to have an elegant solution for you tomorrow, and if not, I'll have a slightly less elegant solution tomorrow that works just as well. :)
All the best,
Chris

By Codee - September 8, 2009

Chris,
Thanks! Will work in and test the plugin you created shortly and get back to you.

BTW, will I have to redo these changes when I upgrade or is this becoming part of the next version?

By Codee - September 8, 2009

Chris,
I did all the steps down to the line you wrote:
"I hope this helps! Please let me know if you have any questions or run into any problems. "
and then tested it. It "mostly" worked. There is a series of index errors:
"Notice: Undefined index: parentNum in /home/content/e/q/u/equipmart/html/emaAdmin/lib/viewer_functions.php on line 660 Notice: Undefined index: parentNum in /home/content/e/q/u/equipmart/html/emaAdmin/lib/viewer_functions.php on line 660 Notice: Undefined index: parentNum in /home/content/e/q/u/equipmart/html/emaAdmin/lib/viewer_functions.php on line 660 Notice: Undefined index: parentNum in /home/content/e/q/u/equipmart/html/emaAdmin/lib/viewer_functions.php on line 660 Notice: Undefined index: depth in /home/content/e/q/u/equipmart/html/emaAdmin/lib/viewer_functions.php on line 675 Notice: Undefined index: depth in /home/content/e/q/u/equipmart/html/emaAdmin/lib/viewer_functions.php on line 685 Notice: Undefined index: depth in /home/content/e/q/u/equipmart/html/emaAdmin/lib/viewer_functions.php on line 699 Notice: Undefined index: depth in /home/content/e/q/u/equipmart/html/emaAdmin/lib/viewer_functions.php on line 703 Notice: Undefined index: depth in /home/content/e/q/u/equipmart/html/emaAdmin/lib/viewer_functions.php on line 675 Notice: Undefined index: depth in /home/content/e/q/u/equipmart/html/emaAdmin/lib/viewer_functions.php on line 685 Notice: Undefined index: depth in /home/content/e/q/u/equipmart/html/emaAdmin/lib/viewer_functions.php on line 699 Notice: Undefined index: depth in /home/content/e/q/u/equipmart/html/emaAdmin/lib/viewer_functions.php on line 703 Notice: Undefined index: depth in /home/content/e/q/u/equipmart/html/emaAdmin/lib/viewer_functions.php on line 675 Notice: Undefined index: depth in /home/content/e/q/u/equipmart/html/emaAdmin/lib/viewer_functions.php on line 685 Notice: Undefined index: depth in /home/content/e/q/u/equipmart/html/emaAdmin/lib/viewer_functions.php on line 699 Notice: Undefined index: depth in /home/content/e/q/u/equipmart/html/emaAdmin/lib/viewer_functions.php on line 703 Notice: Undefined index: depth in /home/content/e/q/u/equipmart/html/emaAdmin/lib/viewer_functions.php on line 675 Notice: Undefined index: depth in /home/content/e/q/u/equipmart/html/emaAdmin/lib/viewer_functions.php on line 685 Notice: Undefined index: depth in /home/content/e/q/u/equipmart/html/emaAdmin/lib/viewer_functions.php on line 699 Notice: Undefined index: depth in /home/content/e/q/u/equipmart/html/emaAdmin/lib/viewer_functions.php on line 703 "

I've attached a screenshot of the resulting error.

testing the other portion of the help you gave and will report back.
Attachments:

errorsnapshot_mfg.gif 73K

Re: [equinox69] Just not understanding how to set up Category menus

By Chris - September 8, 2009 - edited: September 8, 2009

Hmm. It sounds like you have set up one of your sections as a Category Menu? I know I suggested that at the top of this thread, but that was before I understood what you wanted to accomplish. To get this working, you'll need all four sections to be Multi Record.

On second thought, are you calling getCategories() instead of getRecords() somewhere? Since these are Multi Record sections and not Category Menus, you can't use getCategories().

If that doesn't help, please attach the PHP source code of that page and I'll have a look.
All the best,
Chris

By Codee - September 8, 2009

Hi Chris,
chris wrote: <I'm assuming you're working with a Detail viewer page for Inventory records, and your STEP 1 code looks like this: >

I got that to work for the detail page but had to axe out the stuff for equipment_type because it keeps erring (related to other error post?)...BUT the same issue occurs on the List viewer page. So, if you don't mind, how do I modify the top step 1 code on the list viewer page? Right now it reads:
list($inventoryRecords, $inventoryMetaData) = getRecords(array(
'tableName' => 'inventory',
'perPage' => '7',
));

thanks!

By Codee - September 8, 2009

Each menu we added: Manufacturer, Model, Equipment Type are all set as Multi record menus. I will go and check the call for each and see if they're calling get categories and report back to you.

Just so you know, I am a complete novice coder. I know html. Working with CMSB I am learning a lot but when it comes to MySQL code, php code/tags that are not html, etc. I'm really lame.

By Codee - September 8, 2009

Chris,
OK, I've simply restarted the coding process you gave for the left menu - it's working.

Just so you know, "equipment_types" is "equipment_type" on this side.

Now, your code for the detail page viewer is erroring with regards to equipment type. It happens whenever there is a 2-word named equipment type like "air compressors". Here's the error I get when I try to view the page:
"MySQL Error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'Compressors)) ORDER BY dragSortOrder DESC' at line 3 "

If I take the space out between "air compressors", changing it to "aircompressors" or "air-compressors" etc. the error goes away...is there a better fix?

Also, on the inventoryDetail.php page, what code do I use to display the equipment type? Using the following doesn't work:
<?php if ($record['equipment_type']): ?>
<b/><?php echo $record['equipment_type']['title'] ?>&nbsp;</b/>
<?php endif ?>

Thanks!
Hi Chris,

I got this to work the way I wanted to, thanks for the plugin, made my life easy. I was just wondering what is the injectionField' for? Are you referring to SQL Injection or are you actually creating a field on the fly at some point in the mysql database?

Thanks
Graphic Lingoes
www.graphiclingoes.com