We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

A complicated one. How can I get the entries of a Child of a Child of a Parrent Channel

How Do I?

bobural's avatar
bobural
20 posts
7 years ago
bobural's avatar bobural

I have the following scenario:

  • child channel “Car Models” where I store all the car models I have.
  • relationship field to…
  • parent channel “Car Brand” where I store car brand. When I add an entry here I can select the car models relevant to that car brand I want as relationship. (ex. Ford brand entry has Ford GT and Ford Mustang as related entries from child channel “Car Models” )

  • a third channel “Car Reviews” with a channel form so a normal user can add a review in the front end

  • relationship field to…
  • channel “Car Brand”

my questions. in the channel form I have a select to get all my Car Brand entry but I cannot get their child related entries from “Car Models” channel…

For example: On the front-end a user writes a review using my channel form for channel “Car Reviews” and selects Ford brand to post a review…. but I do not know how can I get the entries related to Ford (Mustang, GT, etc) in this channel form.

Any pointers would be highly appreciated.

Thank you.

       
James Catt's avatar
James Catt
17 posts
7 years ago
James Catt's avatar James Catt

Can you not use categories for the car brand instead of a channel + relationships? That would make it super simple.

If that doesn’t work for you, you might be able to do it with an embed, something like:

{embed="my_embed_template" parent_entry_id="1234"} // where 1234 is the entry_id for the brand

Then in the embedded template:

{exp:channel:entries channel="carbrand" entry_id="{embed:parent_entry_id}"}

  {relationship_field}

    // great stuff about cars here

  {/relationship_field}

{/exp:channel:entries}
       
bobural's avatar
bobural
20 posts
7 years ago
bobural's avatar bobural

Thank you James,

I do not know if you or anyone else understood me but I did a small drowning - image: ()

       

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.