Modify Next> and <Previus Hello,
I would like to edit the Nex> and < Prev links at the bottom of the main content area so they call a javascript and pass the url rather than call the url itself in a pop-up.
I assume that mosMainBody() actually loads content.html.php. If this is correct then I found the following code which I believe loads the links into Next and Prev:
/**
* Writes Next & Prev navigation button
*/
function Navigation( &$row, &$params ) {
global $task;
$link_part = 'index.php?option=com_content&task=view&id =';
// determines links to next and prev content items within category
if ( $params->get( 'item_navigation' ) ) {
if ( $row->prev ) {
$row->prev = sefRelToAbs( $link_part . $row->prev . $row->Itemid_link );
} else {
$row->prev = 0;
}
if ( $row->next ) {
$row->next = sefRelToAbs( $link_part . $row->next . $row->Itemid_link );
} else {
$row->next = 0;
}
}
if ( $params->get( 'item_navigation' ) && ( $task == 'view' ) && !$params->get( 'popup' ) && ( $row->prev || $row->next ) ) {
?>
<table align="center" style="margin-top: 25px;">
<tr>
<?php
if ( $row->prev ) {
?>
<th class="pagenav_prev">
<a href="<?php echo $row->prev; ?>">
<?php echo _ITEM_PREVIOUS; ?></a>
</th>
<?php
}
if ( $row->prev && $row->next ) {
?>
<td width="50">
</td>
<?php
}
if ( $row->next ) {
?>
<th class="pagenav_next">
<a href="<?php echo $row->next; ?>">
<?php echo _ITEM_NEXT; ?></a>
</th>
<?php
}
?>
</tr>
</table>
<?php
}
}
If this is correct then I assume this is where I need to implement the change. Can anyone give me an example what the code would look like if my javaScript function name is loadPage() for example?
Thanks in advance |