67 Posts
Bonitto
7 years ago
3
Topic

Hello,

So I am trying to understand the best way to show field data associated with another content type and I am assuming that SEBLOD’s Search Join plugin can get the job done but no luck as yet. Or if I am going about this the wrong way and there’s another solution please help guide me i the right direction.

I have 2 content types: Locations, Procedures.

In my Location’s content type, I have a Dynamic Checkbox field that allows a user to select all of the Procedures assigned to this location (field name: location_assigned_procedures).

In my Procedure’s content type I have a Menu Item field (procedure_menu_item) which I am using to store the Menu Item links associated with each procedure.

Now here’s what I am trying to accomplish.

On my Locations Content View, which I am outputting via the seb_minima template override, I would like to output the Assigned Procedures and the Menu Item associated with each assigned procedure.

I created a List and Search Type (List Location Procedures), that will be referenced in my Location content type’s Content View by way of the Seblod List & Search Field.

In my List Location Procedures Search Form View, I have the following fields and settings:

CCK

  • Live Value = Procedures
  • Match = Exact

Assigned Procedures

  • Match = Any Words Exact / Comma Separated / Unquoted

Procedure Search Join

  • LEFT JOIN
    • #__cck_store_form_locations, location_assigned_procedures
    • #__cck_store_form_medical_procedures, id

I am currently using the Table Template for my List View (eventually I will switch to List Template (Advanced) > set_minima Item View) but I figured this would be the easiest way to see how is my data being outputted.

In my List view, I have the Article ID field and the Menu Item field. Remember all I want to show are the Procedure Menu Items that have been assigned to a Location. Now I am assuming that because the data I need is in another table, I need to use the Search Join Field.

So I followed the tutorial of the Search Join field here: https://www.seblod.com/resources/tutorials/how-to-use-the-search-join-field to try and left join my tables but I see I have several problems I need to figure out.

  1. Since the Dynamic Checkbox field (location_assigned_procedures) stores a list of comma separated values in my #__cck_store_form_locations table, I don’t know how I will be able to LEFT JOIN my #__cck_store_form_medical_procedures table by it’s ID column
  2. What’s another alternative approach to what I’m trying to accomplish?

Keep in mind, my skill sets are not the strongest when dealing with databases so you may have to break things down in layman terms for me please lol. Thanks for any help that you can provide.

You can view the page I’m working on my dev site here. If you scroll all the way down to the Procedures Performed at This Location section, you'll get a better idea of what I mean.

Get a VIP membership
4229 Posts
Kadministrator
7 years ago
2
Level 1

You don't need join field to list related articles, you just need to pass relevant parent value to child list where you do the search based on this field's value. See example here

https://www.seblod.com/community/forums/lists-search-types/how-to-display-a-list-of-items-chosen-manually

67 Posts
Bonitto
7 years ago
1
Level 2

Thanks to the help of the amazing Bucklash and his genius, I was able to figure out where I was going wrong.

I had the incorrect matching set on my art_id field. I needed to set the matching to Any Words Exact / Separated by , / and Select Multiple.

I had my art_id set to exact since I assumed it wasn't a comma separated value field. That is where I was confused.

Thank you guys again.

4229 Posts
Kadministrator
7 years ago
0
Level 3

This is why I linked the above post :)

Get a Book for SEBLOD