 |

andycal
User
Jun 8, 2008, 6:33 AM
Post #1 of 5
(245 views)
Shortcut
|
Anyone got any clue how to use 'categories'?
|
|
|  |
 |

Dave
Staff
/ Moderator

Jun 9, 2008, 11:30 AM
Post #2 of 5
(226 views)
Shortcut
|
Hi andycal, Categories are a bit of an advanced feature right now, but maybe I can help you out. Have you created any other CMS Builder section editors or viewers yet? And what did you want to use categories for? Dave Edis - Senior Developer interactivetools.com
|
|
|  |
 |

andycal
User
Jun 11, 2008, 6:22 AM
Post #3 of 5
(216 views)
Shortcut
|
Hiya, I was juist wondering how to use them to display stuff, but having looked at the database tables it looks pretty straight forward. I'm going to have a play with writing my own code for now, I guess it will be a lot easier in later versions of CMS builder.
|
|
|  |
 |

Dave
Staff
/ Moderator

Jun 11, 2008, 9:52 AM
Post #4 of 5
(209 views)
Shortcut
|
It's pretty much the same as with a regular list of records, except it automatically figured out and assigns a value for 'depth'. So say your variable is named $record['depth'] you can use that to display different classnames (menudepth0, menuDepth1, etc) or use PHP to display different html based on the depth:
<?php foreach ($categoryRecords as $record): ?> <?php if ($record['depth'] == 0): ?> <?php echo $record['name'] ?> <?php endif ?> <?php if ($record['depth'] == 1): ?> - <?php echo $record['name'] ?> <?php endif ?> <?php if ($record['depth'] == 2): ?> - <?php echo $record['name'] ?> <?php endif ?> <?php endoforeach ?> The first step is to figure out how you want your categories to look in HTML. Then figure out how to get CMS Builder to output that. Hope that helps, let me know if you need any more assistance with this one. And yes in future we'll add more options to the code generator to automatically generate category menus for you. Dave Edis - Senior Developer interactivetools.com
|
|
|  |
 |

andycal
User
Jun 11, 2008, 10:11 AM
Post #5 of 5
(207 views)
Shortcut
|
Very cool! Thanks Dave, just off to buy another couple of copies by the way, before the offer ends!
|
|
|  |
|