hi David
I want to setup a categorie called : "Session A/B/C (from 10 to 20 years)"
if i try to create manually, it says it has invalid characters
when I import the categorie from the feed it appears as :"Session A B C from 10 20 years"
I have reading and it's due to the normalise function to make friendly urls.
Is there any way to have the categories with the special characters and the url with the normalised characters?
categorie name: Session A/B/C (from 10 to 20 years)
categorie link: Session A B C from 10 20 years
thanks in advance
javier
thanks a lot for your quick response!
I'm using the beta version, but I managed to make the changes (step 1 and 2)
Step 3 it's already done on the categories.php beta version.
ok. Now my categories name says "Session A/B/C (from 10 to 20 years)"
and my categorie url says "http://www.midomain.com/category/Session-A%2FB%2FC-%28from-10-to-20-years%29/"
but when I clic on link I get the error 404.
I suspect I could be for the .htacess ?
thats mine
{code saved}
Hi,
Ah - there's the normalisation of the input query at the top of search.php that will need to be dealt with - line 6:
$q = (isset($_GET["q"])?tapestry_normalise($_GET["q"],":\."):"");
...if you REPLACE that with:
$q = (isset($_GET["q"])?$_GET["q"]:"");
...that will again remove normalisation and should serve the results...
Cheers,
David.
--
PriceTapestry.com
I'm afraid, I still get the same 404 error ....
I've try to change "(" for "[" or for "{" but the same result
I've noticed something new. Now in the search box of categories, instead of
"category: name of category:"
appears automatically
"category:name-of-category:" and display no results (becuase in the table is stored as "name of category" not as "name-of-category")
if I write manually on the search box "category: name of category:" then it works
(I've notice this last if because of the change
$q = (isset($_GET["q"])?$_GET["q"]:"");
Any idea?
thanks
javier
Hi javier,
I'm most concerned about the 404, as even "out of the box" a category name containing "/" characters should still redirect to search.php, albeit return zero results. Could you please email me a link to your site, plus any relevant modified files and I'll check it all out for you...
Cheers,
David.
--
PriceTapestry.com
Hi David,
How to do something similar with Version (12/10B)
How to display category names with an apostrophe like Men's, Women's and keep clean urls like mens, womens.
I tried the code above but that's for an older version.
And, I don't want to add extra characters, I just wan to use the category names that have an apostrophe, on some feeds.
Thanks.
Hi Capricorn,
To allow importing of apostrophe characters in the category field the equivalent mod for 12/10B is first look for the following code at line 189 of includes/admin.php
$importRecord["category"] = tapestry_normalise($importRecord["category"]);
...and REPLACE with
$importRecord["category"] = tapestry_normalise($importRecord["category"],"'");
And then in search.php at line 6 look for:
$q = (isset($_GET["q"])?tapestry_normalise($_GET["q"],":\."):"");
...and REPLACE with
$q = (isset($_GET["q"])?tapestry_normalise($_GET["q"],"':\."):"");
That's all that's required for the latest distribution as equivalent to the above however if you do want "Men's" for display but only "Mens" in the URL that can be done but involves adding a new field (normalised_category) and index to the products table - let me know if you'd like to implement that...
Cheers,
David.
--
PriceTapestry.com
Hi Javier,
Based on the 11/09 distribution (latest version, not the beta), it should be fairly straight forward to modify to allow these characters. Firstly, if you're entering them manually on Feed Registration Step 2, in includes/feed_registration_step2.php look for the following code at line 39:
if(!ereg("^[0-9a-zA-Z\. ]{0,255}$",$_POST["user_category"]) )
...and replace with:
if(0)
Next, in includes/admin.php, look for the following code beginning at line 164:
if ($importRecord["category"])
{
$importRecord["category"] = tapestry_normalise($importRecord["category"]);
}
..and either comment out or DELETE that block to prevent the categories from being changed at all.
Finally, in categories.php, look for the following code at line 20:
$item["href"] = tapestry_hyphenate($product["category"])."/";
...and REPLACE with:
$item["href"] = urlencode(tapestry_hyphenate($product["category"]))."/";
Hope this helps!
Cheers,
David.
--
PriceTapestry.com