You are here:  » Capital letters

Support Forum



Capital letters

Submitted by Bob on Wed, 2007-02-07 17:30 in

Hi there,

How can I replace capital letters of brands and force all brand names to have only the first letter as a capital one?

Also I am trying to remove category:whatever: from the search box in forms leaving it only with a product or brand name when some searches are being done through coded links. I tried str_replace and it works fine for one category only but if I try to catch all categories with an array I can't get it work.

Many thanks.

Bob

Submitted by support on Wed, 2007-02-07 17:40

Hi Bob,

You can use the "Name Case" filter to make all your brand names apear neatly with only the first letter capitalised. Click filters alongside the feed from the admin page, and then add a "Name Case" filter against the "Brand" field - that should do the trick (you will need to import again).

To change the content of the search box after the query it is probably easier to use the $parts array instead of $q. For a category search, $parts[0] is always "category".

Something that may help is to use the following alternative html/searchform.php:

<div class='searchform'>
  <form name='search' action='<?php print $config_baseHREF ?>search.php'>
    <input type='text' name='q' size='35' value='<?php print (isset($parts[2])?$parts[2]:(isset($parts[1])?$parts[1]:$parts[0])); ?>' />
    <input type='submit' value='<?php print translate("Search"); ?>' />
  </form>
</div>

If that doesn't work; can you post a couple of examples of the text in the box and what you want instead and i'll have a look for you...

Cheers,
David.

Submitted by Bob on Wed, 2007-02-07 19:17

David,

It's working.

Thanks a lot.

Bob