Categories

6 posts by 2 authors in: Forums > CMS Builder
Last Post: April 5, 2010   (RSS)

By aev - March 10, 2010

Hi,

can anyone explain these:

categoryRecord['_listItemStart']
categoryRecord['_listItemEnd']


Are they only for inputting the <li> and </li> tags? If yes, what is the benfit of using them?

-aev-

Re: [chris] Categories

By aev - April 4, 2010

When using this technique to create navigation menus from a Category section, we are not able to add classes to the UL and LI tags.

And I know we can use something like this #nav li { styles } to style the listitems simply placed within a div called #nav, but we often need something like this #nav .isSelected to style specific listitems. Or #nav .toplevelItem or #nav .childItem or...

How can we solve this?

-aev-

Re: [aev] Categories

By Chris - April 5, 2010

Hi aev,

One option for styling the selected category is to insert extra HTML inside the LI and style that:

<?php
echo $category['_listItemStart'];

if ($category['_isSelected']) {
echo '<span class="isSelected">';
}
else {
echo '<span class="notSelected">';
}

echo $category['name'];

echo '</span>';

echo $category['_listItemEnd'];
?>


To style top level items, you could have an overriding rule for nested LIs:

#nav li { top level styles }
#nav li li { child styles }


Does that help? Please let me know.
All the best,
Chris

Re: [chris] Categories

By aev - April 5, 2010

Thanks for your suggestions, they will suffice as workarounds, but I don't think they are good enough for our permanent way of handling this.

As this will be an important part of every CMSB site we build it needs better control and we don't like adding extra html markup to solve this.

-aev-

Re: [aev] Categories

By Chris - April 5, 2010

Hi aev,

Your requirements could be solved with custom programming.

If you have a PHP programmer, point them to the functions _getListItemStartTags and _getListItemEndTags in viewer_functions.php. The code isn't terribly complicated, so it shouldn't be too hard to customize.

Alternately, we could solve this for you through our consulting department. Please let me know if that's something you're interested in.
All the best,
Chris