Generate a unique list?

Options

Is it possible to grab a set of distinct values from a generated list? Say, for example, that I have maps of various areas with location info in their CT, and I want to generate a list of the states for all the maps I have sitewide.

Tagged:

Comments

  • I accomplished this for a content type I had by making the state field a category and then create a list filter for each state.

  • Seamus Leahy:

    I accomplished this for a content type I had by making the state field a category and then create a list filter for each state.

    Okay, thanks. What I wanted to do will be impossible (and it would be so easy with backend access....select distinct, anyone?), but I'll roll with that and we should be able to get something together.

  • Jim Drey:

    Okay, thanks. What I wanted to do will be impossible (and it would be so easy with backend access....select distinct, anyone?), but I'll roll with that and we should be able to get something together.

    I hear ya. Maybe something like the Facebook Query Language (FQL) for building more complex queries.

  • Jim Drey:

    Okay, thanks. What I wanted to do will be impossible (and it would be so easy with backend access....select distinct, anyone?), but I'll roll with that and we should be able to get something together.

    This may not be impossible but it may be not recommended. How many content items are in the set from which you wish to "select distinct"?

  • Bruce Keilin:

    This may not be impossible but it may be not recommended. How many content items are in the set from which you wish to "select distinct"?

    192 right now. We're still in deployment, though.

  • Jim Drey:

    192 right now. We're still in deployment, though.

    For fields that you can sort by (in a List) you can write a template that looks for changes to the property from one item to the next. When a change occurs, you know that you have at least one item with that value. So if you had 5 items of CT "Foo" with a property called "bar", you could create a list of Foos ordered by bar and a List template that looked like this:

  • Bruce Keilin:

    For fields that you can sort by (in a List) you can write a template that looks for changes to the property from one item to the next. When a change occurs, you know that you have at least one item with that value. So if you had 5 items of CT "Foo" with a property called "bar", you could create a list of Foos ordered by bar and a List template that looked like this:

    That's a creative solution, Bruce! I'll try it out once we're rolling - we brute forced the issue for now.

Categories