Jump to content

Download: Database Category Block with Category Record Count


Sailfindragon

Recommended Posts

Posted

File Name: Database Category Block with Category Record Count
File Submitter: Sailfindragon
File Submitted: 22 Nov 2010
File Updated: 22 Nov 2010
File 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;'>

				&bull; <a href='{$this->registry->ccsFunctions->returnDatabaseUrl( $r['category']['category_database_id'], $r['category']['category_id'] )}'>{$r['category']['category_name']}&nbsp;({$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']}&nbsp;({$sub['category_records']})</a>

								</li>

							</foreach>



Click here to download this file

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...