ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Searching within related entries

February 05, 2010 1:38pm

Subscribe [2]
  • #1 / Feb 05, 2010 1:38pm

    hermanobrother

    44 posts

    Hi, I’m using EE2 for this.

    I’ve got a projects Channel called “clients” and another Channel called “projects”.

    In the Projects channel I have a custom_field that’s a relationship field with the Clients channel. That way, when I submit a project I’ve done, I can select from a drop down menu for which client it was done for.

    Now in my browser I’m showing a bunch of logos of Clients. When you click a logo I pass the url_title of that client in the URL of the browser like this:

    mysite.com/projects/client_name

    The problem: My intention was to take that client_name and tell EE “Get me all the stuff in my Projects channel that I’ve done for this particular client”. I wanted to do this with the

    search:client="client_name"

    But it turns out that I can’t do a search in a Relationship Custom Field. Why in the world? How do people then use Relationship fields?

    And how can I accomplish what I wanted?

    Thanks,

    G.

  • #2 / Mar 25, 2010 12:55am

    bryan2jumpstart

    98 posts

    You need to use the related_entries tag. So basically inside your channel tag for the client use a related entries with an id o the custom field name and that will pull the projects. Or in your case you might need to use a reverse related entries. It’s kind of late but look into the documentation about those two tags and you should be able to work it out.

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases