Linking categories, and creating hyperlinks to each

4 posts by 2 authors in: Forums > CMS Builder
Last Post: April 14, 2011   (RSS)

By degreesnorth - April 12, 2011

Hi

How would I link a category, and provide a hyperlink to this specific category. For example, I have a list of subcategories, each with just a title (for the name of that category). On the brand page, I want to be able to "tick" which of the subcategories this particular brand provides (provided as a checkbox list), and then provide a hyperlink to that specific category. Each brand could have one or more subcategories which it needs to link to.

When I just tried to create the first step, adding the code for the subcategories (Categories: <?php echo join(', ', getListLabels('brands', 'categories', $brandsRecord['categories'])); ?>, I got this message "PRODUCT categories: There was an error creating the list field. MySQL Error: Table 'menu_audio_com_au.cms_subcategories' doesn't exist", so I am kinda stuck. Yes, the "subcategories" list does exist - did I need to include the load records for subcategories in the header section as well?

Any help would be appreciated. Thx.

Re: [degreesnorth] Linking categories, and creating hyperlinks to each

By Jason - April 13, 2011

Hi,

If you need the labels of the categories that were selected for a given brand record, you can use the :labels pseudo field. This will give you an array of those labels.

Try something like this:

Catgegories: <?php echo join(", ", $brandsRecord['categories:labels']);?>

Hope this helps
---------------------------------------------------
Jason Sauchuk - Project Manager
interactivetools.com

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

Re: [Jason] Linking categories, and creating hyperlinks to each

By degreesnorth - April 13, 2011

I'll try that, but how do I hyperlink each of the categories? that is, so each of the categories is a link which goes to those pages?