How to create clean URLs for category strings? This code for linking to a category page:

href="/products/?category={{ category.slug }}"


Generates this URL:  www.website.com/products/?category=category-name

Can someone please tell me how to code links in menus (etc) that will produce URLs without the ?category= string being included in the URL.  So that the URL would become: www.website.com/products/category-name

Many thanks for your help - it is greatly appreciated!
First thing you'll need to do is set up a route that ensures anything for /products/category-name gets routed to the correct template. You can do this from the control panel or via craft/config/routes.php

If you do this in your routes.php file you'd need something like this:

return array(
    'products/(.*?)' =&gt; 'products/index',
);


Which is telling Craft that for any url that contains products/any-characters it should use the products/index template.

Then, on that template, grab the segment that is the category slug

{% set catSegment = craft.request.segment(2) %}


You'll then need to get the category that has that slug

{% set category = craft.categories.slug(catSegment).first() %}


You then have a category model you can work with and can use a craft entries tag with a category criteria using

{% set products = craft.entries.relatedTo(category).find() %}


Loop through products to output your products.