Jump to content

Is the ?d= parameter really necessary in Pages categories?


Recommended Posts

Hello,

Here in our install we found the following issue.

Because the source code adds the ?d= parameter in $table->baseUrl, navigation links also have this parameter.

For example, for our https://www.clubedohardware.com.br/noticias/armazenamento/ page, the default navigation becomes https://www.clubedohardware.com.br/noticias/armazenamento/page/2/?d=6, https://www.clubedohardware.com.br/noticias/armazenamento/page/3/?d=6 and so on, instead of just https://www.clubedohardware.com.br/noticias/armazenamento/page/2/, https://www.clubedohardware.com.br/noticias/armazenamento/page/3/ etcetera.

To fix this, I had to edit /applications/cms/modules/front/database/category.php and remove the following line:

$table->baseUrl = $table->baseUrl->setQueryString( 'd', \IPS\cms\Databases\Dispatcher::i()->databaseId );

I know we have a very customized Pages configuration here, but I am giving you a heads up to check whether this line should really exist.

Cheers!

Link to comment
Share on other sites

11 hours ago, Gabriel Torres said:

Hello,

Here in our install we found the following issue.

Because the source code adds the ?d= parameter in $table->baseUrl, navigation links also have this parameter.

For example, for our https://www.clubedohardware.com.br/noticias/armazenamento/ page, the default navigation becomes https://www.clubedohardware.com.br/noticias/armazenamento/page/2/?d=6, https://www.clubedohardware.com.br/noticias/armazenamento/page/3/?d=6 and so on, instead of just https://www.clubedohardware.com.br/noticias/armazenamento/page/2/, https://www.clubedohardware.com.br/noticias/armazenamento/page/3/ etcetera.

To fix this, I had to edit /applications/cms/modules/front/database/category.php and remove the following line:

$table->baseUrl = $table->baseUrl->setQueryString( 'd', \IPS\cms\Databases\Dispatcher::i()->databaseId );

I know we have a very customized Pages configuration here, but I am giving you a heads up to check whether this line should really exist.

Cheers!

This is used to load the form when the database isn't set on a page, @Gabriel Torres:

	/**
	 * Show the pre add record form. This is used when no category is set.
	 *
	 * @return	void
	 */
	protected function form()
	{
		...

		}
		else if ( \IPS\cms\Pages\Page::$currentPage === NULL and \IPS\cms\Databases\Dispatcher::i()->databaseId === NULL and isset( \IPS\Request::i()->d ) )
		{
			\IPS\cms\Pages\Page::$currentPage = \IPS\cms\Pages\Page::loadByDatabaseId( \IPS\Request::i()->d );
		}

 

Link to comment
Share on other sites

  • 2 weeks later...
On 1/5/2022 at 1:18 PM, Gabriel Torres said:

@Adriano Faria @Marc Stridgen My suggestion then is for the source code to check wether the database is set or not and add the ?d= parameter only if the database isn't set. Because the navigation URL looks ugly, we are exposing the database ID, and this may also influence SEO.

Sorry, Ive just seen this. You would need to post up within our suggestions area if you are looking for a change to be added to the platform there

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...