To enable pagination in CommunityBuilder, you need to edit the comprofiler.html.php file located at '/components/com_profiler'. Find the following code around line 1542 ('---' separates code here):
---
<th style='text-align:center;'><?php echo _UE_CONNECTION; ?></th>
<th style='text-align:center;'><?php echo _UE_CONNECTIONTYPE; ?></th>
<th style='text-align:center;'><?php echo _UE_CONNECTIONCOMMENT; ?></th>
</tr></thead>
<tbody>
<?php
---
Exactly after '<?php' tag insert this:
---
/*** PREPARE PAGINATION START ***/
// number of connections per page
define('P_CONNECTIONS_PER_PAGE', 4);
global $Itemid, $limitstart, $limit;
// total number of connections
$total = count($connections);
// index of the first displayed connection
$limitstart = $limitstart ? $limitstart : 0;
$limit = $limit ? $limit : P_CONNECTIONS_PER_PAGE;
// modify array to contain only connections for this page
$connections = array_slice($connections, $limitstart, $limit);
/*** PREPARE PAGINATION END ***/
---
Then scroll down till you find the following code (around line 1600 after first edit):
---
echo "\n</tr>";
$i= ($i==1) ? 2 : 1;
}
echo "</tbody>";
echo "</table><br />";
---
After 'echo "</table><br />";' insert this:
---
/*** PAGINATION LINKS START ***/
// include standard Joomla page navigation class
require_once( $GLOBALS . '/includes/pageNavigation.php' );
// create the object
$pageNav = new mosPageNav( $total, $limitstart, $limit );
// base link
$link = "index.php?option=com_comprofiler&Itemid=$itemid&task=manageConnections";
// display pagination bar
echo '<center>' . $pageNav->writePagesLinks( $link ) . '</center>';
/*** PAGINATION LINKS END ***/
---
Save the file. Enjoy.
Please Log in to join the conversation.
Please Log in to join the conversation.
Please Log in to join the conversation.
Please Log in to join the conversation.
Please Log in to join the conversation.
Please Log in to join the conversation.