2

How do I get the Joomla-3.x pagination prev/next link, using the getData() function, in the content plugin with the onContentPrepare event?

What is the work of $limitstart here: onContentPrepare($context, &$article, &$params, $limitstart)

2 Answers 2

1

I haven't looked close enough to verify, but you might want to have a look at:

$article->pagination 

print_r that bad-boy to see what's in it. I believe that's going to contain the links you're looking for.

onContentPrepare $limitstart designated which page of a paginated article to start on. If you've used pagebreaks, this is used. Convenient if you want your content plugin to run on only certain pages.

2
  • I want to get the pagination in the $view == 'category'. For example, if there is more pages then set metadata. Else in the first page set metadata. Also get the prev/next page. $this->pagination->getData() works in the article component category view. How to get this from the content plugin. Commented Apr 26, 2016 at 19:45
  • That makes things tougher, because the content plugins work on each individual article, not on the category itself (maybe in the category description though...) I'll have a closer look at this tonight. I'm sure something can be found. Commented Apr 27, 2016 at 20:06
1

The arguments name is "page" not "limitstart". From the docs it mans: "An integer that determines the "page" of the content that is to be generated. Note that in the context of views that might not generate HTML output, a page is a reasonably abstract concept that depends on the context."

https://docs.joomla.org/Plugin/Events/Content

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.