Product Category Listing - Easier to Read

4 posts by 3 authors in: Forums > CMS Builder
Last Post: April 29, 2014   (RSS)

By Chris - April 29, 2014

Hi Perch,

Wow, I literally just came up with a hyphen-space solution for someone else on our forums who wanted parent categories bolded (in a checkbox list). Try this:

List Options:

Get options from MySQL query (advanced)

SELECT `num`, CONCAT(IF(`depth`, '- ', ''), `name`)
FROM `<?php echo $TABLE_PREFIX ?>pages`
WHERE pageType = "productCat"
ORDER BY lineage

My initial solution was CONCAT(REPEAT('- ', `depth`), `name`), but that mysteriously crashed my local Mysql server. Let me know if you have records with more than 2 levels of depth.

Does that help? Let me know if you have any questions.

All the best,
Chris

By Perchpole - April 29, 2014

Chris -

Heavens to Murgatroyd!

I wish you'd come up with this yesterday. I decided to have a go at it myself today and it took me hours!

My solution is not nearly as elegant as your own, however.

Thanks,

:0)

Perch

By rconring - April 29, 2014

Holy Smoke!  Been wanting that solution forever!

Thanks Chris

Ron Conring
Conring Automation Services
----------------------------------------
Software for Business and Industry Since 1987