-
☆ A M B ☆
- 476 Posts
How do I go about setting up Ditto (or any other snippet) giving the ability for the visitor to be able to sort documents by certain criteria?
For example, I’m building an Ecommerce site and we’ve got a page selling belts. We need to set it so that the visitor can sort by belt size from a drop down menu. Curious how I should go about setting up the Template Variables and such to handle this request. And obviously how do I set it so that sorting is possible for the visitor to choose a belt size and have all those belts output? I know Reflect can handle something very similar by tagging documents, but I need to figure out a way so that if I have 10 belts that all have size 34’ waist, that 10 instances for the 34’ category don’t show up in the drop down menu. Hope that makes sense.
Precision Web Development ... SmashStack.com
-
☆ A M B ☆
- 2,475 Posts
If I were you, I’d probably write my own SQL statements in a Snippet and perform the sorts in SQL, or alternatively, return the data in a table that you sort using Javascript (this has limitations, however).
-
☆ A M B ☆
- 476 Posts
Hey Everett,
Thanks for the response. I pretty much know very little programming (apart from CSS and XHTML), so that may be out of my skillset. I was hoping their was a snippet already for this or someone that had maybe pulled this off before and discussed it in the forums.
Precision Web Development ... SmashStack.com
-
☆ A M B ☆
- 2,475 Posts
Ok, if you’re unable to do custom SQL queries, then a really simple implementation of this might be to create several pages that will display search results, each with a slightly different Snippet call -- the only thing that would change between them would be the "sort-by" attribute (whatever that parameter name is for the snippet you’re using).
Would that work for you?
-
☆ A M B ☆
- 476 Posts
Thanks for the advice Everett...that may be a bit difficult and time consuming to set up, but it is an idea nonetheless.
Precision Web Development ... SmashStack.com
-
☆ A M B ☆
- 2,475 Posts
Lol... I never said it was a GOOD idea. But simple in principle... haha.
-
☆ A M B ☆
- 476 Posts
HA!
Yeh, it actually gave me a few ideas to work with...thanks so much!
Precision Web Development ... SmashStack.com