Categories
6 posts by 2 authors in: Forums > CMS Builder
Last Post: April 5, 2010 (RSS)
By aev - March 10, 2010
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: [aev] Categories
By Chris - March 11, 2010
_listItemStart and _listItemEnd produce <li> and </li> tags, as well as <ul> and </ul> tags to adjust records to the correct indentation when subcategories are present.
I hope this helps. Please let me know if you have any questions.
Chris
Re: [chris] Categories
By aev - April 4, 2010
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
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.
Chris
Re: [chris] Categories
By aev - April 5, 2010
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
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.
Chris