We've retired the forum in favor of GitHub Discussions.

New conversations can be started on GitHub. Existing conversations will remain for a while longer.

Head over to GitHub →

Getting correct title to output - Cascade problem?

Jon Hicks December 4, 2019 by Jon Hicks

I've been reading https://docs.statamic.com/knowledge-base/wrong-variables and wondering if this is the cause of an issue I'm having. So far I've not cracked it.

I have a collection loop, where the entries feature a taxonomy and a checkbox fieldtype, and at the moment, I can get the {{ value }} to output a value, but not the {{ title }}. The parent entry title outputs instead.

Here is a condensed version of what I have (just showing the relevant fields):

{{ collection:networking :taxonomy:country="slug" as="entries" }}   

        {{ entries }}
            {{ expertise }}
               {{ value }}
            {{ /expertise }}       

            {{ if works_in }}
                {{ works_in }}
                    {{ value }}
                {{ /works_in }}</p>
            {{ /if }}            
        {{ /entries }}

    {{ /collection:networking }}

In this example, 'expertise' is checkbox fieldtype, and 'works_in' is a taxonomy fieldtype that uses a 'country' taxonomy. Entries are grouped by the country taxonomy. 'If I change {{ value }} to {{ title }} I just get the collection entry title, instead of the title associated with the value in the fieldset or taxonomy.

Here's an example entry, with fields reduced to relevant ones:

organization: 'Company Name'
  - special-skill
  - country/brazil
  - country/columbia
title: 'Persons Name'
  - argentina

Can anyone see where I'm going wrong?

Answered by Erin Dalzell!
>>>>>>> Answered <<<<<<<
7 Replies