You are here:  » Hyphen in Category / Brand


Hyphen in Category / Brand

Submitted by endurado on Mon, 2014-01-20 17:46 in

Hello David,
I'm stuck again with a problem concerning hyphens, this time in category-names. In this case no search result is shown for the category because all '-' are deleted from hyperlink for q in search.php.
I used only category names without hyphens to make it work, but now I have extended the script and have a new custom field similar to category and brand that is navigated the same way from the menu. As it contains model series, the hyphens are essential there.

I cannot keep all hyphens from url, as there are also blanks in the series names that are filled with hyphens for url. The only idea I have is, to use the id instead of the series/category name for q, but then I don't have the nice url.

It would be great if you have any idea how to use category names/brands with hyphens.

Thanks a lot in advance!

Sven

Submitted by support on Mon, 2014-01-20 21:00

Hello Sven,

The tidiest solution is to hold separate versions of category / brand / your new custom fields for the purposes of search / use in the URL (in the same way as there are 2 versions of the product name in the database - `name` (normal version) and `normalised_name` (URL safe version).

If you would like to email me your current:

includes/admin.php
categories.php
search.php

...I'll implement for `category`, which you can then copy easily to apply the same to brand or any other index field...

Cheers,
David.
--
PriceTapestry.com