Tell me more ×
ExpressionEngine® Answers is a question and answer site for administrators, end users, developers and designers for ExpressionEngine® CMS. It's 100% free, no registration required.

I need the list of category names, but only the categories that have been tagged in entries that are related (a Playa relationship) to another entry (I know, it's getting down to snow-fortress Inception levels).

Here's my Low Variable (an early-parsed textarea variable), called "lv_region_entry_ids":

{exp:channel:entries url_title="{segment_3}"}{exp:playa:parent_ids}{/exp:channel:entries}

And here's the place I'm trying to use it:

{exp:gwcode_categories entry_id="{lv_region_entry_ids}"} (some code) {/exp:gwcode_categories}

That doesn't work, and I've read in a few places that when dealing with LV and Playa you have to use the pair tag instead of the the global variable syntax. But that's where I'm drawing a blank on how to do that.

share|improve this question
1  
What do you get when you just put {lv_region_entry_ids} in a template by itself? Is it actually being parsed? – Stephen Callender Aug 14 at 23:28

2 Answers

What happens if you move your lv_region_entry_ids code into your template wrapped in a stash:set pair, like this?

{exp:stash:set name="region_entry_ids" parse_tags="yes"}
  {exp:channel:entries url_title="{segment_3}" dynamic="no" disable="pagination|member_data|categories}{exp:playa:parent_ids}{/exp:channel:entries}
{/exp:stash:set}

Then, in the same template call/get the value like this:

{exp:gwcode_categories entry_id="{stash:region_entry_ids}"}
  (some code)
{/exp:gwcode_categories}
share|improve this answer

The code that ends up in the template with your current setup is this:

{exp:gwcode_categories entry_id="{exp:channel:entries url_title="{segment_3}"}{exp:playa:parent_ids}{/exp:channel:entries}"}
  (some code)
{/exp:gwcode_categories}

Can you see the problem now? You're using two tags as input for another tag's parameter value. On top of that, the double quotes are clashing; the value for entry_id actually is {exp:channel:entries url_title= instead of the whole tag.

You can try using single quotes for either the gwcode_categories tag or channel:entries tag and adding parse="inward" to the gwcode_categories tag to try and parse the parameter value. If that doesn't work, use embeds or perhaps Stash, like Stephen suggested.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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