Invision Community 4: SEO, prepare for v5 and dormant account notifications By Matt Monday at 02:04 PM
Martin A. Posted August 23, 2019 Posted August 23, 2019 Ever since the introduction of the SEO friendly pagination \IPS\Request::i()->page has been empty. In \IPS\cms\Databases\Dispatcher::run you extract this data, and adds it to the request object. You mind doing this for other pages too, not just pages that use the {database} template tag?
bfarber Posted August 26, 2019 Posted August 26, 2019 I'm not sure I'm following - I don't see anywhere in that method where we're pulling out pagination information. Do you have an example of a page not working or something that did in previous versions?
newbie LAC Posted August 26, 2019 Posted August 26, 2019 52 minutes ago, bfarber said: Do you have an example of a page not working or something that did in previous versions?
Martin A. Posted August 26, 2019 Author Posted August 26, 2019 4 hours ago, bfarber said: I'm not sure I'm following - I don't see anywhere in that method where we're pulling out pagination information. 4 hours ago, bfarber said: Do you have an example of a page not working or something that did in previous versions? After SEO pagination was introduced, the pagination in the URL is considered a part of the SEO title in Pages. For a page titles "123test", the path in \IPS\Request::$_data is "123test/page/1". {{$featuredNewsRecordsClass = '\IPS\cms\Records1';}} {{$featuredNewsWhere = array( array( 'record_locked=?', 0 ) );}} {{$url = \IPS\Http\Url::internal( "app=cms&module=pages&controller=page&path=" . \IPS\cms\Pages\Page::$currentPage->full_path, 'front', 'content_page_path', \IPS\cms\Pages\Page::$currentPage->full_path );}} {{$count = 0;}} {{$page = isset( \IPS\Request::i()->page ) ? intval( \IPS\Request::i()->page ) : 1;}} {{$limit = 11 * ( $page - 1 );}} {{$articles = $featuredNewsRecordsClass::getItemsWithPermission( $featuredNewsWhere, 'record_featured DESC, record_publish_date DESC', array( $limit, 11 ), 'read', \IPS\Content\Hideable::FILTER_AUTOMATIC, 0, NULL, TRUE, FALSE, FALSE, FALSE );}} {{$count = $featuredNewsRecordsClass::getItemsWithPermission( $featuredNewsWhere, 'record_featured DESC, record_publish_date DESC', array( $limit, 11 ), 'read', \IPS\Content\Hideable::FILTER_AUTOMATIC, 0, NULL, FALSE, FALSE, FALSE, TRUE );}} {{$pagination = array( 'page' => $page, 'pages' => ( $count > 0 ) ? ceil( $count / 11 ) : 1 );}} {{if $page > $pagination['pages']}} {{\IPS\Output::i()->redirect( \IPS\Request::i()->url()->setQueryString( 'page', 1 ), NULL, 303 );}} {{endif}} It looks something like this. If I var_dump the request object I get this: [data:protected] => Array ( [app] => cms [module] => pages [controller] => page [path] => 123test/page/2 ) I copied the code in the screenshot above into a method in my app which I call before the page code in order to temporarily solve this.
bfarber Posted August 26, 2019 Posted August 26, 2019 I've added an internal bug report to have that issue checked on.
Recommended Posts
Archived
This topic is now archived and is closed to further replies.