Sailfindragon Posted November 22, 2010 Posted November 22, 2010 File Name: Database Category Block with Category Record CountFile Submitter: SailfindragonFile Submitted: 22 Nov 2010File Updated: 22 Nov 2010File Category: IP.Content Blocks If you wish to have the total records count show next to each category within the category block. Copy this code into your block template.<div class='general_box'> <h3>{$title}</h3> <ul class='hfeed'> <if test="is_array( $records ) && count( $records )"> {parse striping="feed_striping" classes="row1,row2 altrow"} <foreach loop="$records as $r"> <li class='hentry {parse striping="feed_striping"}' style='padding: 4px 4px 4px {parse expression="$r['level']*20"}px;'> • <a href='{$this->registry->ccsFunctions->returnDatabaseUrl( $r['category']['category_database_id'], $r['category']['category_id'] )}'>{$r['category']['category_name']} ({$r['category']['category_records']})</a> </li> </foreach> </if> </ul> </div> <br /> If you are using the media category block that came with the IP Content Demo Replace this <foreach loop="$this->_categories[ $r['category_id'] ] as $sub"> <li> <a href='{$this->registry->ccsFunctions->returnDatabaseUrl( $sub['category_database_id'], $sub['category_id'] )}'>{$sub['category_name']}</a> </li> </foreach> With <foreach loop="$this->_categories[ $r['category_id'] ] as $sub"> <li> <a href='{$this->registry->ccsFunctions->returnDatabaseUrl( $sub['category_database_id'], $sub['category_id'] )}'>{$sub['category_name']} ({$sub['category_records']})</a> </li> </foreach> Click here to download this file
Recommended Posts
Archived
This topic is now archived and is closed to further replies.