hi guys,
I have built a page which lists products from a mysql table using a snippet. easy.
(products are initially added/modified and deleted in a custom module backend)
when you click on an item i need it go to a more details page (kind of like a catalog)
the problem
how can i take advantage of modx’s seo for the details page so that in the pagename it has the product name in it?
the basic way without the seo would be for me to have a snippet on a ’details page’ which uses a $_GET[’id’] variable to obtain details about that product.
is there a better way, so that seo is enabled, through use of a plugin maybe?
one sketchy way i was thinking is when you create a new product via the module it will also create a record in the modx content table with an alias set and the document’s content will be a snippet. it seems pretty bad to do it like this though.
hope this makes sense!
thank you for your help.
-
MODX Staff
- 10,725 Posts
Just use the name of the product in the URL (as a query string parameter) and/or author custom rewrite conditions/rules to handle your custom query string parameter and make it part of the URL.
thanks opengeek,
is there any documentation or similar snippets which i could learn from to do this?