Any help would be greatly appreciated! I hope I explained my situation in enough detail to get the help that is needed.
Currently I have two channels that need to share information. This is going from one channel to an other.
Channel One is called Resellers This information needs to be feed into my other channel called Products. Reseller contains info about various resellers, places to purchase a product. In this channel I have a field for Category. The category is actually a Country name. The rest of the fields are plain text.
Channel 2 is called Products Products has various fields but I am interested in doing is pulling in info from Resellers and displaying it. I am able to pull in everything from Resellers except for the Category name.
In Products I have a matrix field that contains an entry field and a plain text field. The entry field pulls in the information about each reseller. The plain text field allows me to override a field from Reseller to display per product information. I got this part working without an issue.
What I am trying to create is the following structure: Country name then under the country list out each reseller alphabetically. You will see Country Name A, A means nothing it just shows alphabetical listing.
Country Name A
- Reseller A
- Reseller T
Country Name C
- Reseller D
- Reseller H
- Reseller R
- Reseller T
Below I have listed out my field handle names that are relevant to this issue.
From Resellers
- rdCountry - field where category is selected from
I am able to pull in all other fields easily that are part of Resellers.
From Products
- Matrix field - chooseResellers
- Entries field - chooseReseller
- Plain text field - customProductLink
Again I am able to display each reseller just fine. What I am having issues with is pulling in the Category/Country name. Once I pull in the country name I might need help with setting up my loop to display everything.
Thanks for your time and help, it is greatly appreciated!
EDIT: So the below code seems to solve my issue listed above. Now I just gotta loop through everything correctly.
{% for entry in craft.entries.slug(entrySlug).find() %}
{% for block in entry.chooseResellers %}
{% for reseller in block.chooseReseller %}
<h3>{{ reseller.rdCountry.first() }}</h3>
{% endfor %}
{% endfor %}{# /matrix #}
{% endfor %}{# /for product #}
EDIT TWO - the code solves part of the problem but I do not think will allow me to loop through everything as I was expecting. Help is appreciated!