0

I've done some searching but I haven't found an answer. Or if I have it was a little over my head and I may have missed it.

I'm working on a website that has a catalog of specific publications. Essentially, I want to show, first, a list of available titles. As far as I've ready the only way to show one of each title, and not each entry, is through an {exp:query SELECT DISTINCT...} string. That's fine. That's getting the single entry from each of the available titles. (For more information, I'm returning all of that information as inline elements so they'll be arranged nicely on the page.)

So, here's the issue I'm seeing; the exp:query pulls from exp_channel_data_field_15, which does not contain the URL_Titles. If I run an {exp:channel:entries...} tag within the tags of the query it just returns everything in the channel. I tried to filter it out by only getting one that looks for the specific entry_id, as they match, but I haven't been able to modify the SQL query to include that and still only return the single result per title.

I looked into relationships, but since this is a query function I don't think it will work?

So, to recap. I have a channel that has a list of publications (multiple issues of multiple titles) that includes URL_title. I'm not able to generate the only-unique entries of the title names without the exp query. But that exp query runs on a record that doesn't have the url_title.

Is there a way to do this that I'm overlooking? Is there another way to list the unique title entries to only show one of each title that I'm not using?

  • 1
    Looks like I was overthinking this. I have a working example setup with Categories instead of using a field in the channel. It took some tweaking but I was able to get something put together. – Matt Slater Feb 17 at 3:14
  • Cool, glad you got it sorted. Feel free to post your solution as an answer and to mark it as accepted (that is encouraged). – Alex Kendrick Feb 24 at 18:28
0
{exp:channel:category_archive channel="msdc" style="linear"}
{categories}
{exp:channel:entries channel="msdc" category="{category_id}" limit="1"}
{category_image}
{/exp:channel:entries}
{/categories}
{/exp:channel:category_archive}

Seems like it may be double-dipping or not optimized, but it shows one from each category.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.