0

I'm running a query on a playa field and the output is grouping a few values together. I just want to be able to access the second and third parts but am a little confused how to do it.

Code:

{exp:query sql="SELECT DISTINCT field_id_200 AS brand FROM exp_channel_data WHERE channel_id=23"}
  {brand}
{/exp:query}

Output:

[125] [nike] Nike

Any ideas for how I can just access "nike" and "Nike"?

Thanks

  • 1
    any reason you need the query module? – Steven Grant Dec 23 '14 at 10:11
  • I have a product catalogue and wanted to create a secondary navigation for brand, category and subcategory . From what I can see it doesn't seem to be possible to achieve this natively using channels or with a playa field when the categories are specifically related to a selected brand. – Adeeb Khan Dec 24 '14 at 4:08
  • 1
    Have you tried using Playa's module tags, as opposed to field tags? It seems like you should be able to use {exp:playa:children} for instance. – Tyssen Dec 24 '14 at 7:33
0

It looks like I don't even need to use the query module and can just use Stash to both match and display unique entries to create the secondary navigation.

You learn something new everyday with Stash!

| 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.