You are here:  » convert all URL into small caps


convert all URL into small caps

Submitted by atman on Mon, 2006-11-27 19:27 in

hi,

is it possible to convert product name URL into all small caps?

example:

Product-Name-Model123.html into product-name-model1123.html
PRODUCTNAME.html into productname.html

thank you

Submitted by support on Mon, 2006-11-27 19:37

Hiya,

This should work ok. The product name is written into the URL on line 143 of search.php as follows:

$searchresults["products"][$k]["productHREF"] = "product/".tapestry_hyphenate($product["name"]).".html";

You can add a strtolower() here as follows:

$searchresults["products"][$k]["productHREF"] = "product/".tapestry_hyphenate(strtolower($product["name"])).".html";

The other place you would need to do this is in sitemap.php, line 24:

$sitemapHREF = "product/".urlencode(str_replace(" ","-",$row["name"])).".html";

...change to:

$sitemapHREF = "product/".urlencode(strtolower(str_replace(" ","-",$row["name"]))).".html";

That should do the trick.

Cheers,
David.

Submitted by atman on Mon, 2006-11-27 20:02

thanks david,

had a minor issue with product page.
the "review this product" link and the "Related Products" is still showing a

Product-Name.html URL

thanks.

Submitted by atman on Mon, 2006-11-27 20:17

ok. resolved the issue. :)

thanks.

Submitted by chrisst1 on Tue, 2006-11-28 18:03

David
Apart from the product name is it possible to code the description to show lower case only.

Chris

Submitted by support on Tue, 2006-11-28 18:10

Hi Chris,

It would be best to do this during import rather than have to strtolower each place in the code where the description is displayed.

To do this; look for the following code in includes/admin.php (line 161):

    if ($admin_importFeed["field_description"])
    {

...and add the following line:

      $record[$admin_importFeed["field_description"]] = strtolower($record[$admin_importFeed["field_description"]]);

You will need to import again before the change takes effect.

Cheers,
David.

Submitted by chrisst1 on Tue, 2006-11-28 18:17

David

That should do the trick (my php for dummies did not suggest that!)

Many thanks

Chris