Trailing Slash for Product URL
Forum rules
Always add your TYPO3, Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
Always add your TYPO3, Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
Trailing Slash for Product URL
Hello,
I would like to set a trailing slash to the product-urls. My config.yaml looks like this
I tried the solution for Problems with routeEnhancers and Slash PageTypeSuffix but it didn't worked.
Also played around with something like this
and
Also tried with
but didn't worked either.
Do you have any suggestions whats maybe wrong with my config?
Typo3: 11.5.9
Aimeos: 21.10.5
Thanks a lot!
Regards
David
I would like to set a trailing slash to the product-urls. My config.yaml looks like this
Code: Select all
- { routePath: '/{d_prodid}-{d_pos}-{d_name}', _controller: 'Catalog::detail' }
Also played around with something like this
Code: Select all
- { routePath: '/{d_prodid}-{d_pos}-{d_name}/', _controller: 'Catalog::detail' }
Code: Select all
default: /
suffix: /
index: /
map:
/: 0
stock: 191351524
Code: Select all
return $this->view->url($detailTarget, $detailController, $detailAction, $params, ['d_name' => '/'], $detailConfig);
Do you have any suggestions whats maybe wrong with my config?
Typo3: 11.5.9
Aimeos: 21.10.5
Thanks a lot!
Regards
David
Re: Trailing Slash for Product URL
That's a TYPO3 specific question you should better ask in a TYPO3 related forum.
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, give us a star
If you like Aimeos, give us a star
Re: Trailing Slash for Product URL
Hey thanks for your reply,
but I think it's not a TYPO3-related issue. Because if I add a "/" to the product URL I get the error message:
Item with ID "/" in "product.id" not found. So I think Aimeos checks the url after the last slash?!
If I add some other characters like "+" or "=" the url ends with that characters.
/p/123-name+ -> no problem
/p/123-name= -> no problem
/p/123-name/ -> doesnt work
If I use Aimeos\MW\View ->url(.., $trailing,...) and I add ->url(..., ['/'],...) the url looks like this
/p/123-name#/ -> no problem
why I cant use the ->url() method without the '#' char?
Regards
David
but I think it's not a TYPO3-related issue. Because if I add a "/" to the product URL I get the error message:
Item with ID "/" in "product.id" not found. So I think Aimeos checks the url after the last slash?!
If I add some other characters like "+" or "=" the url ends with that characters.
/p/123-name+ -> no problem
/p/123-name= -> no problem
/p/123-name/ -> doesnt work
If I use Aimeos\MW\View ->url(.., $trailing,...) and I add ->url(..., ['/'],...) the url looks like this
/p/123-name#/ -> no problem
why I cant use the ->url() method without the '#' char?
Regards
David
Re: Trailing Slash for Product URL
Your configured route path is "/{d_prodid}-{d_pos}-{d_name}/". Thus, you need URLs like "/p/123-0-name/" and "/p/123-name/" can't be resolved correctly by TYPO3 (because the d_pos parameter is missing).
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, give us a star
If you like Aimeos, give us a star