Pagination.php function override?

  • Posts: 34
  • Thank you received: 1
11 years 4 months ago #117225

-- HikaShop version -- : 2.2
-- Joomla version -- : 3.1
-- PHP version -- : 5.3

I'm just wondering is it possible to have an override for the following function that is located in the pagination.php file:

function _list_render($list){
		$html = null;

		$html .= '<span class="pagenav_start_chevron">&lt;&lt; </span>';
		$html .= $list['start']['data'];
		$html .= '<span class="pagenav_previous_chevron"> &lt; </span>';
		$html .= $list['previous']['data'];
		foreach( $list['pages'] as $page ) {
			$html .= ' '.$page['data'];
		}
		$html .= ' '. $list['next']['data'];
		$html .= '<span class="pagenav_next_chevron"> &gt;</span>';
		$html .= ' '. $list['end']['data'];
		$html .= '<span class="pagenav_end_chevron"> &gt;&gt;</span>';

		return $html;
	}

I remember seeing a post somewhere saying there will be an over-ride available from v2.1 - but I can't seem to find how to do it. Help appreciated thanks.

Last edit: 11 years 4 months ago by ximbo.

Please Log in or Create an account to join the conversation.

  • Posts: 12953
  • Thank you received: 1778
11 years 4 months ago #117267

Hi,

Sure you can edit this code if you want to, but you should maybe give some precision about what you really want to do if you want some help :).

Please Log in or Create an account to join the conversation.

  • Posts: 34
  • Thank you received: 1
11 years 4 months ago #117318

Hi Mohamed,

Thanks for the quick reply, sorry, I may not have phrased my post clearly there above. What I mean is, is there a way to override that function so that in the event of an update, my changes will not be lost? I see some instructions to override other fucntions in other php files on the website and I see the if statements in the php that will execute the override if it exists, but I don't see this in the pagination.php file, for this particular function. So if I edit directly and upload, I will just lose changes on any future update.

Last edit: 11 years 4 months ago by ximbo.

Please Log in or Create an account to join the conversation.

  • Posts: 83024
  • Thank you received: 13403
  • MODERATOR
11 years 4 months ago #117351

Hi,

There is no instruction on our website to override pagination because we use the standard pagination system of Joomla.
So if you want to override a function of the pagination, you can refer to joomla's documentation.
For example, for that function:
stackoverflow.com/questions/16512074/joo...-pagination-override
So from what I can read, it's the function pagination_list_render that you need to implement in your override file.

The following user(s) said Thank You: ximbo

Please Log in or Create an account to join the conversation.

  • Posts: 34
  • Thank you received: 1
11 years 4 months ago #118611

Thanks - figured it out using this help file: docs.joomla.org/Understanding_Output_Overrides

Just had to put the pagination.php file with the function I'm overriding into the /html folder of my template.

Please Log in or Create an account to join the conversation.

Time to create page: 0.071 seconds
Powered by Kunena Forum