Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

adding page numbers to tags & category lists #539

Open
raramuridesign opened this issue Jun 22, 2021 · 3 comments
Open

adding page numbers to tags & category lists #539

raramuridesign opened this issue Jun 22, 2021 · 3 comments

Comments

@raramuridesign
Copy link

@fevangelou
Would it be possible to add paging to the title of the page when navigating through different pages.
See this link for an example of an override
https://stackoverflow.com/questions/36481633/joomla-k2-change-pagination-titles-by-adding-number-of-the-page-to-the-paginatio

Matt

@raramuridesign
Copy link
Author

Or if you can explain how to add custom titles to list, tags and search lists that would be great too.
ie the code ;-)

@fevangelou
Copy link
Member

I'll note it down as a feature to add.

If you wish to add it on your own, you can simply check the related variables in the URL and adjust the page's <title>.

You'll obviously need to make your own overrides.

Here's an example for the K2 blog (using URLs like https://getk2.org/blog?start=X for pagination where X is the item number where the output starts, so https://getk2.org/blog?start=6, https://getk2.org/blog?start=12, https://getk2.org/blog?start=18 etc.). This modifies the category.php layout:

<?php
// (copyrights are here)

// no direct access
defined('_JEXEC') or die;

// Adjust the title for pagination
$document = JFactory::getDocument();
$documentTitle = $document->getTitle();
$startCounter = JRequest::getInt('start');
$step = 6; // how many items are shown each time - IMPORTANT
$page = ($startCounter >= $step) ? $startCounter/$step : 0;
if ($page > 0) {
    $document->setTitle($documentTitle.' - Page '.$page); // This is where we set the title
}

A rough implementation but should do the trick.

@raramuridesign
Copy link
Author

@fevangelou Thanks. I have taken a similar approach, although I added in custom description as well based on the paging.
Manged to get this to work on TAGS and NORMAL CATEGORY VIEW
I am going to use the if statement, as this will be a good addition.

It would be great of this was in the core.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants