URL sanatize with "-" instead of "_"
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!
-
- Posts: 42
- Joined: 15 Dec 2015, 20:32
URL sanatize with "-" instead of "_"
Hi,
I just want to know if there is a simple way to have the product names etc. sanitized with "-" instead of "_"
If I am correct what will work is to set:
$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['aimeos']['aimeos_view_url']
Copy the Method:
\Aimeos\Aimeos\Base\View::addUrl
without the callable check and replace \Aimeos\MW\View\Helper\Url\T3Cli
and \Aimeos\MW\View\Helper\Url\Typo3
with my own classes that extend the original and add a own sanatize method that
is a copy of the method from \Aimeos\MW\View\Helper\Url\Base
but in preg_replace it replaces the "_" instead with "-".
i am asking because:
1.) I think it looks better
2.) realurl is by default using "-" and with 2.0.x the parameter to modify it has become deprecated, so it would be better to use the same sanatize parameter as realurl does.
Is there a simpler solution?
If not, is there a possibility that I might run intro troubles when using "-" instead of "_"?
I guess it would always work correctly for "d_name" and "f_name" as those are optional parameters but what about those that set the $all parameter?
In that regard: I noticed an issue with the realurl autoconfiguration:
The parameter ai[c_step] is not set always, e.g. on the payment success url which results in "..//.." being used, however that might not be transferred correctly by the payment provider etc. so I think this parameter should be split instead.
I just want to know if there is a simple way to have the product names etc. sanitized with "-" instead of "_"
If I am correct what will work is to set:
$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['aimeos']['aimeos_view_url']
Copy the Method:
\Aimeos\Aimeos\Base\View::addUrl
without the callable check and replace \Aimeos\MW\View\Helper\Url\T3Cli
and \Aimeos\MW\View\Helper\Url\Typo3
with my own classes that extend the original and add a own sanatize method that
is a copy of the method from \Aimeos\MW\View\Helper\Url\Base
but in preg_replace it replaces the "_" instead with "-".
i am asking because:
1.) I think it looks better
2.) realurl is by default using "-" and with 2.0.x the parameter to modify it has become deprecated, so it would be better to use the same sanatize parameter as realurl does.
Is there a simpler solution?
If not, is there a possibility that I might run intro troubles when using "-" instead of "_"?
I guess it would always work correctly for "d_name" and "f_name" as those are optional parameters but what about those that set the $all parameter?
In that regard: I noticed an issue with the realurl autoconfiguration:
Code: Select all
'co' => array(
array( 'GETvar' => 'ai[c_step]' ),
array( 'GETvar' => 'code' ),
array( 'GETvar' => 'orderid' ),
),
Re: URL sanatize with "-" instead of "_"
If you add a product text with type "url" (or fill the "URL segment" field in the simple mode admin interface), you can define how the product names are displayed in the URL.
Regarding ai[c_step]: Yes, your are right, that should be split.
Could you create a Github PR which creates a realurl config for /checkout/confirm as "cc" only with code and orderid?
Regarding ai[c_step]: Yes, your are right, that should be split.
Could you create a Github PR which creates a realurl config for /checkout/confirm as "cc" only with code and orderid?
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
-
- Posts: 42
- Joined: 15 Dec 2015, 20:32
Re: URL sanatize with "-" instead of "_"
OK.
But I still think there should be an option to automatically sanitize those names accordingly.
Regarding PR:
https://github.com/aimeos/aimeos-typo3/pull/14
But I still think there should be an option to automatically sanitize those names accordingly.
Regarding PR:
https://github.com/aimeos/aimeos-typo3/pull/14
Re: URL sanatize with "-" instead of "_"
Sanitize URL parameters are more complex than just using "_" or "-" for some characters. Think about non-latin languages. Thus we've decided to leave this to the shop owners so they can exactly define what they want the URL to look like.
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
-
- Posts: 42
- Joined: 15 Dec 2015, 20:32
Re: URL sanatize with "-" instead of "_"
That's true, of course, but I meant the default behaviour if there is no url segement.