Skip to main content
rewording and English improvements
Source Link
Farahmand
  • 2.3k
  • 1
  • 17
  • 28

In my component, I am using Joomla default pagination calling $this->pagination->getPagesLinks() in the view template file.

Say, my component url is like this at a certain point: http://localhost/joomla/index.php/menu-item-name?cid=79&tid=3 and when a page link is clicked, I want that url to omit the component related parameters (cid=79&tid=3). So when going to the desired page, that url becomes http://localhost/joomla/index.php/menu-item-name?start=2.

So how do I achieve this? WhatWhat pagination class functions can I override? I could not find a way because if I override getPagesLinks() in the JPagination class, it would not work because pagination links are generated from template's overridden files too.

Please help me in both Joomla 2.5 and 3

Edit: Ok, I implemented router.php. In it's build() function...

$segments[] = $query['cid']; $segments[] = $query['tid']; if (isset($query['start'])) { $segments[] = $query['start']; unset($query['start']); } unset($query['cid']); unset($query['tid']); unset($query['view']); 

and in the parse() function...

$vars['view'] = 'category'; $vars['cid'] = $segments[0]; $vars['tid'] = $segments[1]; $vars['start'] = $segments[2]; return $vars; 

So when I load my component without any variables in the url, the next page link in pagination becomes http://localhost/joomla3.3/menu-item-name/2, even when component has some variables in the url then the url look like http://localhost/joomla3.3/menu-item-name/4/79/2. Both of these urls' last 2 is the pagination's page value (like start=2), but when I click a page link, it's not going to next page but staying and loading some items in same page.

So how do I make the pagination links work with router because I don't simply want ?start=2 to be added to the end of the url.

In my component, I am using Joomla default pagination calling $this->pagination->getPagesLinks() in the view template file.

Say, my component url is like this at a certain point: http://localhost/joomla/index.php/menu-item-name?cid=79&tid=3 and when a page link is clicked, I want that url to omit the component related parameters (cid=79&tid=3). So when going to the desired page, that url becomes http://localhost/joomla/index.php/menu-item-name?start=2.

So how do I achieve this? What pagination class functions can I override? I could not find a way because if I override getPagesLinks() in the JPagination class, it would not work because pagination links are generated from template's overridden files too.

Please help me in both Joomla 2.5 and 3

Edit: Ok, I implemented router.php. In it's build() function...

$segments[] = $query['cid']; $segments[] = $query['tid']; if (isset($query['start'])) { $segments[] = $query['start']; unset($query['start']); } unset($query['cid']); unset($query['tid']); unset($query['view']); 

and in the parse() function...

$vars['view'] = 'category'; $vars['cid'] = $segments[0]; $vars['tid'] = $segments[1]; $vars['start'] = $segments[2]; return $vars; 

So when I load my component without any variables in the url, the next page link in pagination becomes http://localhost/joomla3.3/menu-item-name/2, even when component has some variables in the url then the url look like http://localhost/joomla3.3/menu-item-name/4/79/2. Both of these urls' last 2 is the pagination's page value (like start=2), but when I click a page link, it's not going to next page but staying and loading some items in same page.

So how do I make the pagination links work with router because I don't simply want ?start=2 to be added to the end of the url.

In my component, I am using Joomla default pagination calling $this->pagination->getPagesLinks() in the view template file.

Say, my component url is like this at a certain point: http://localhost/joomla/index.php/menu-item-name?cid=79&tid=3 and when a page link is clicked, I want that url to omit the component related parameters (cid=79&tid=3). So when going to the desired page, that url becomes http://localhost/joomla/index.php/menu-item-name?start=2.

So how do I achieve this? What pagination class functions can I override? I could not find a way because if I override getPagesLinks() in the JPagination class, it would not work because pagination links are generated from template's overridden files too.

Please help me in both Joomla 2.5 and 3

Edit: Ok, I implemented router.php. In it's build() function...

$segments[] = $query['cid']; $segments[] = $query['tid']; if (isset($query['start'])) { $segments[] = $query['start']; unset($query['start']); } unset($query['cid']); unset($query['tid']); unset($query['view']); 

and in the parse() function...

$vars['view'] = 'category'; $vars['cid'] = $segments[0]; $vars['tid'] = $segments[1]; $vars['start'] = $segments[2]; return $vars; 

So when I load my component without any variables in the url, the next page link in pagination becomes http://localhost/joomla3.3/menu-item-name/2, even when component has some variables in the url then the url look like http://localhost/joomla3.3/menu-item-name/4/79/2. Both of these urls' last 2 is the pagination's page value (like start=2), but when I click a page link, it's not going to next page but staying and loading some items in same page.

So how do I make the pagination links work with router because I don't simply want ?start=2 to be added to the end of the url.

overrding How to override/customize pagination links?

In my component i, I am using joomlaJoomla default pagination calling $this->pagination->getPagesLinks() in the view template file. 

Say, my component url is like this at a certain point -: http://localhost/joomla/index.php/menu-item-name?cid=79&tid=3 and when a page linkslink is clicked i, I want that url will not containto omit the component related parameters like (cid=79&tid=3). So when going to the desired page so, that url becomes http://localhost/joomla/index.php/menu-item-name?start=2 as it's my unique requirement for reasons.

So how do iI achieve this, what? What pagination class functions i can I override as i? I could not find waysa way because if iI override getPagesLinks() classgetPagesLinks() in the JPagination class, it would not work out asbecause pagination links are generated from template's overridden files too. So ways please

Please help me in both jJoomla 2.5 and 3 Asap??

Edit: ok iOk, I implemented router.phprouter.php. In it's build() function -build() function...

$segments[] = $query['cid'];$segments[]$query['cid']; $segments[] = $query['tid']; if (isset($query['start'])) {  $segments[] = $query['start'];  unset($query['start']);   } unset($query['cid']);   unset($query['tid']);   unset($query['view']); 

and in parse() functionthe -parse() function...

$vars['view'] = 'category';   $vars['cid'] = $segments[0]; $vars['tid'] = $segments[1];$vars['start']$segments[1]; $vars['start'] = $segments[2]; return $vars; 

soSo when iI load my component without any variablevariables in the url, the next page link in pagination becomes http://localhost/joomla3.3/menu-item-name/2, even when component has some varsvariables in the url then the url look like http://localhost/joomla3.3/menu-item-name/4/79/2. Both of these urls' last 2 is the pagination's page value  (like start=2start=2). But, but when iI click a page link, it's not going to next page but staying and loading some items in same page. 

So how do iI make the pagination links work with router as ibecause I don't simply want ?start=2?start=2 to be added at lastto the end of the url.

overrding pagination links

In my component i am using joomla default pagination calling $this->pagination->getPagesLinks() in view template file. Say my component url is like this at a certain point - http://localhost/joomla/index.php/menu-item-name?cid=79&tid=3 and when page links clicked i want that url will not contain component related parameters like cid=79&tid=3 when going to desired page so that url becomes http://localhost/joomla/index.php/menu-item-name?start=2 as it's my unique requirement for reasons.

So how do i achieve this, what pagination class functions i can override as i could not find ways because if i override getPagesLinks() class in JPagination class, it would not work out as pagination links are generated from template's overridden files too. So ways please in both j 2.5 and 3 Asap??

Edit: ok i implemented router.php. In it's build() function -

$segments[] = $query['cid'];$segments[] = $query['tid']; if (isset($query['start'])) { $segments[] = $query['start']; unset($query['start']); } unset($query['cid']); unset($query['tid']); unset($query['view']); 

and in parse() function -

$vars['view'] = 'category'; $vars['cid'] = $segments[0]; $vars['tid'] = $segments[1];$vars['start'] = $segments[2]; return $vars; 

so when i load my component without any variable in url next page link in pagination becomes http://localhost/joomla3.3/menu-item-name/2, even when component has some vars in url then url look like http://localhost/joomla3.3/menu-item-name/4/79/2. Both of these urls' last 2 is the pagination's page value(like start=2). But when i click page link, it's not going to next page but staying and loading some items in same page. So how do i make pagination links work with router as i don't want ?start=2 added at last of url.

How to override/customize pagination links?

In my component, I am using Joomla default pagination calling $this->pagination->getPagesLinks() in the view template file. 

Say, my component url is like this at a certain point: http://localhost/joomla/index.php/menu-item-name?cid=79&tid=3 and when a page link is clicked, I want that url to omit the component related parameters (cid=79&tid=3). So when going to the desired page, that url becomes http://localhost/joomla/index.php/menu-item-name?start=2.

So how do I achieve this? What pagination class functions can I override? I could not find a way because if I override getPagesLinks() in the JPagination class, it would not work because pagination links are generated from template's overridden files too.

Please help me in both Joomla 2.5 and 3

Edit: Ok, I implemented router.php. In it's build() function...

$segments[] = $query['cid']; $segments[] = $query['tid']; if (isset($query['start'])) {  $segments[] = $query['start'];  unset($query['start']);  } unset($query['cid']);  unset($query['tid']);  unset($query['view']); 

and in the parse() function...

$vars['view'] = 'category';  $vars['cid'] = $segments[0]; $vars['tid'] = $segments[1]; $vars['start'] = $segments[2]; return $vars; 

So when I load my component without any variables in the url, the next page link in pagination becomes http://localhost/joomla3.3/menu-item-name/2, even when component has some variables in the url then the url look like http://localhost/joomla3.3/menu-item-name/4/79/2. Both of these urls' last 2 is the pagination's page value  (like start=2), but when I click a page link, it's not going to next page but staying and loading some items in same page. 

So how do I make the pagination links work with router because I don't simply want ?start=2 to be added to the end of the url.

added 1001 characters in body
Source Link
dev-m
  • 1.4k
  • 1
  • 17
  • 27

In my component i am using joomla default pagination calling $this->pagination->getPagesLinks() in view template file. Say my component url is like this at a certain point - http://localhost/joomla/index.php/menu-item-name?cid=79&tid=3 and when page links clicked i want that url will not contain component related parameters like cid=79&tid=3 when going to desired page so that url becomes http://localhost/joomla/index.php/menu-item-name?start=2 as it's my unique requirement for reasons.

So how do i achieve this, what pagination class functions i can override as i could not find ways because if i override getPagesLinks() class in JPagination class, it would not work out as pagination links are generated from template's overridden files too. So ways please in both j 2.5 and 3 Asap??

Edit: ok i implemented router.php. In it's build() function -

$segments[] = $query['cid'];$segments[] = $query['tid']; if (isset($query['start'])) { $segments[] = $query['start']; unset($query['start']); } unset($query['cid']); unset($query['tid']); unset($query['view']); 

and in parse() function -

$vars['view'] = 'category'; $vars['cid'] = $segments[0]; $vars['tid'] = $segments[1];$vars['start'] = $segments[2]; return $vars; 

so when i load my component without any variable in url next page link in pagination becomes http://localhost/joomla3.3/menu-item-name/2, even when component has some vars in url then url look like http://localhost/joomla3.3/menu-item-name/4/79/2. Both of these urls' last 2 is the pagination's page value(like start=2). But when i click page link, it's not going to next page but staying and loading some items in same page. So how do i make pagination links work with router as i don't want ?start=2 added at last of url.

In my component i am using joomla default pagination calling $this->pagination->getPagesLinks() in view template file. Say my component url is like this at a certain point - http://localhost/joomla/index.php/menu-item-name?cid=79&tid=3 and when page links clicked i want that url will not contain component related parameters like cid=79&tid=3 when going to desired page so that url becomes http://localhost/joomla/index.php/menu-item-name?start=2 as it's my unique requirement for reasons.

So how do i achieve this, what pagination class functions i can override as i could not find ways because if i override getPagesLinks() class in JPagination class, it would not work out as pagination links are generated from template's overridden files too. So ways please in both j 2.5 and 3 Asap??

In my component i am using joomla default pagination calling $this->pagination->getPagesLinks() in view template file. Say my component url is like this at a certain point - http://localhost/joomla/index.php/menu-item-name?cid=79&tid=3 and when page links clicked i want that url will not contain component related parameters like cid=79&tid=3 when going to desired page so that url becomes http://localhost/joomla/index.php/menu-item-name?start=2 as it's my unique requirement for reasons.

So how do i achieve this, what pagination class functions i can override as i could not find ways because if i override getPagesLinks() class in JPagination class, it would not work out as pagination links are generated from template's overridden files too. So ways please in both j 2.5 and 3 Asap??

Edit: ok i implemented router.php. In it's build() function -

$segments[] = $query['cid'];$segments[] = $query['tid']; if (isset($query['start'])) { $segments[] = $query['start']; unset($query['start']); } unset($query['cid']); unset($query['tid']); unset($query['view']); 

and in parse() function -

$vars['view'] = 'category'; $vars['cid'] = $segments[0]; $vars['tid'] = $segments[1];$vars['start'] = $segments[2]; return $vars; 

so when i load my component without any variable in url next page link in pagination becomes http://localhost/joomla3.3/menu-item-name/2, even when component has some vars in url then url look like http://localhost/joomla3.3/menu-item-name/4/79/2. Both of these urls' last 2 is the pagination's page value(like start=2). But when i click page link, it's not going to next page but staying and loading some items in same page. So how do i make pagination links work with router as i don't want ?start=2 added at last of url.

Source Link
dev-m
  • 1.4k
  • 1
  • 17
  • 27
Loading