67 Posts
Bonitto
7 years ago
Topic

Hi Guys,

First I'd like to say thank you for creating such an amazing extension. Although the learning curve is a bit steep, once you get the hang of the basics, this thing is nothing short of remarkable.

With that being said, although I am not a newbie to CCK's with WordPress, SEBLOD is the first CCK I've ever used with Joomla so please be patient with me as there are some aspects of documentation that are lacking in terms of how specific field types can be used. Or I'll just blame my plain old ignorance lol.

Here's what I am trying to accomplish:

I have 3 content types.

  1. Medical Procedures (MP)
  2. Preparation Instructions (PI)
  3. History Forms (HF)

Their relationship is as follows:

  1. One PI can be assigned to many MP
  2. One HF can be assigned to many MP
  3. MP pages will output it's own field data and the field data of the Content Types that are assigned to it (PI and HF's)

My main goal is to output Medical Procedures and their related content types.

I saw that James Morell made a reference to use the Dynamic Checkbox field to relate to other content types in this post but specifically to articles by catid using the #__content table. I would like to relate to articles by a content type id of some sort .

I am having a hard time conceptually bridging the gap between what I need and how to use SEBLOD to accomplish this. Also I am assuming that the best way to output the related content types on the medical procedure pages would be via template mainbody override?Any help anyone could provide if I am on the right path and teaching me where I am falling short of my understanding would be greatly appreciated! Thanks 

Get a Book for SEBLOD
1283 Posts
Bucklash
7 years ago
5
Level 1

Hi 

I'm can't resist hijacking forum posts :)

There are many ways of relating content to one another, either way, it is an entry in the db somewhere. list field (SEBLOD Form & List Pack (2 plug-ins)) will show content of a certain content type nested within your content.


Just got to pass the correct values to your list so that it will pull the correct content and that depends on how you have 'related' them

67 Posts
Bonitto
7 years ago
4
Level 2

Thanks so much for your quick response. Unfortunately relating content types to each other is the part I am having problem with. 

How exactly do I relate something uniques by it's content type. What table stores the content type ID or an equivalent that I'd be able to reference?

I have purchase the plugin you advised. I'll play with it and let you know if I get stuck. Thanks for your help.

1283 Posts
Bucklash
7 years ago
3
Level 3

Hi

Note: Relating by content type... not sure if that is necessary, but for you it might be

If I was to only relate

ONE 'pi' to 'mp'

and also...

ONE 'hf' to 'mp'

then I would

create a select dynamic field in my 'mp' content type

ie title 'Related PI',

name 'related_pi'

type 'select_dynamic'

for the query:

text 'title' <- column in db

value 'id' <- column in db

from '#__content'

where 'catid=4' <-or whatever...

storage 'standard' 'article' 'related_pi' alter = int

Then do same for 'hf'

Then in your 'mp' form you will select the 'related_pi' and this will store in db

In your search and list field you would pass this value to the search .....

or something like that ;)

1283 Posts
Bucklash
7 years ago
2
Level 4

Ps

Not sure what you mean by content type id

The id of article?

The id if the actual content type?

The Seblod tables to get your jead round are:

#__cck_core

#__cck_core_fields

#__cck_store_form_my_content_type

#__cck_item_content (or usergroups, memu etc) - this is where data for 'unlocked' fieldd get stored

67 Posts
Bonitto
7 years ago
1
Level 5

Thanks so much again for the detailed post, I sincerely appreciate your help. This will give me something to play with and test ^_^.

When I mentioned the Content Type ID, I am making an assumption that each Content Type had its own unique ID. For instance, I know each article has it's own unique ID in the #__content table but the #__content table does not store the content type ID that the article is associated with since that data is not native to that table. 

The reason why relating by Content Type ID is important for my use case is because there may be articles that are not medical procedures that share the same category and I would not want those items to appear in the selection results (as it would pertain to a stakeholder or myself to be able to choose what PI's or HF's appear on MP's).

Here's a great example of one of my client's websites: 4rai.com/procedures/magnetic-resonance-imaging/3t-mri. Or if you go to procedures and select a procedure, you'll see that each procedure has a description and preparation instructions. This is all being displayed in a not so intuitive manner and that's why I am looking to try and incorporate SEBLOD to solve. Now we'd like to include history forms on each applicable medical procedure but I don't want to just copy and paste HTML modules because forms may change or be modified.

Hopefully it makes sense now why I am choosing to relate by content type ID if possible. SEBLOD is going to output the data on each procedure page just as the example link I provided.

1283 Posts
Bucklash
7 years ago
0
Level 6

Hi

I will read your post again but after a quick glance....

The content type does have it's own id, it is in #__cck_core_types.
Your search type searches based on a content type (you can make it search multiple content types).

It's the first option when you create a new List & Search Type...

In your search form there will be the field 'CCK'

The live value is the content type you selected in the previous step.

The search will get all content of that content type, filtered by any further criteria you add to the form. ie catid etc

This field's storage area tells you where to look for some funky info

Summary....

#__content references a Seblod id for the content item ie ::cck::54::/cck::.

The value '54' is the id in #__cck_core.

In this table you have the content item's id (pk) plus the content type and a few other things.

 

So what have you got in your Search From?

Bucklash

67 Posts
Bonitto
7 years ago
3
Level 1

I finally was able to figure it out. If anyone is interested. Please see my solution below.

Please note that I created template overrides using the seb_minima template so I could control what data I wanted to output and how I wanted to style it in my Content View. OS Training has a great introductory SEBLOD course with James Morrell (Install and Override a Template) that can teach you how to do this, but some level of coding experience (php, html, css) is required. SEBLOD also offers a little tutorial on overriding positions in a template, which is crucial to understanding how to output the fields you created in the backend.

So if anyone else is looking for a solution where you are trying to display a list that will only show related content types within a specific Content View, you will need to do the following:

  1. You will need to purchase the Form and List Pack (2 plugins)
  2. You will also need to install the Dynamic Checkbox field or you can use the Dynamic Select field which comes with SEBLOD by default (I think, lol), but the Checkbox works better in this use case because it allows you to easily select how many content types relate to another content type (in my case I am selecting how many Preparation Instructions relate to a given Medical Procedure - a many to one relationship).
  3. Create your content types with all necessary fields in your Form View (in my example I created Medical Procedures, Preparation Instructions, and History Forms)
    1. Go into your Content View and add all the fields you'd like to display (More than likely you'll want to add the majority of the fields you created in your Form View).
    2. Important: Make sure you add the Article ID field in the Content View. (View Screenshot)
  4. Create your "List and Search Type" (in my case I wanted show a list of related or assigned Preparation Instructions to a Medical Procedure so I created a list and search type for Preparation Instructions)
    1. In the Form View of your "List and Search Type" add the Dynamic Checkbox field we discussed in Step 2 and configure the Construction section according to your use case. My configuration of the construction section is as follows:
      1. Important: This step is crucial because this field is what is going to relate your list to your Content Type by the article ID
      2. In my snapshot, you'll see my Where field contains catid=11 for my use case because I have it set up to put all Preparation Instructions in a specific category by default. If you choose to put your Content Type in a category, you will need to find the category ID that applies to your use case. Please note that you can use other forms of filtering in this Where field, I am still new SEBLOD so I am unsure of what other filtering can be done. (View Screenshot)
    2. Go to Match + Stage (or #3) and set the Match value to Any Words Exact (View Screenshot)
      1. Then make sure you click the plus sign right next to Any Words Exact to set the separator field to a comma (",") and Comparison Rule to Unquoted. (View Screenshot)
    3. Go to the Item View and drag or add all of the fields that you'd like for your list to display/output in the mainbody section.
    4. (Optional) Use the seb_minima template - As I previously stated, I wanted to control the output of each content type and list.
    5. Save & Close
  5. Then go into the Content View of the "Form and Content Type" that you'd like to display the "List & Search Types" on (i.e. I want to display a list of Preparation Instructions that apply to a Medical Procedure. So I would go into my Medical Procedure "Form & Content Type") and do the following:
    1. You should have already added your fields in the Content View as per Step 3.1
    2. Add a new field and select the SEBLOD > List field (View Screenshot) (View Screenshot)
    3. The required "List & Search Type" field should have the exact same name as the "List & Search Type" that we created in Step 4.
    4. In the Construction Section > Fields, add the Dynamic Checkbox field that you used in your "List & Search Type" (i.e. The field I created was labeled Assigned Procedure because I would be assigning a specific Preparation Instruction to Medical Procedure). You'll then see that SEBLOD will automatically show the name of the field now (i.e. assigned_procedure).
    5. Set the field to be the name of the field =art_id. (View Screenshot)
  6. That's all folks. You should now be able to view your article/content type on the front end and depending on your template selection and overrides, you'll now see that your related list is displayed within your content type.

I hope this has been helpful. I am fairly new to SEBLOD so I apologize if this was difficult to follow but finding what you need isn't very straight forward. 

4229 Posts
Kadministrator
7 years ago
2
Level 2

Would be great sf you would make it a tutorial so that it does not get lost in the forum

67 Posts
Bonitto
7 years ago
0
Level 3

Tried to make it a tutorial however it refers back to this post?

https://www.seblod.com/resources/tutorials/relating-displaying-one-to-many-content-types-to-a-content-type

67 Posts
Bonitto
7 years ago
0
Level 3

I have an edit that I'd like to make to the tutorial because I forgot a step, which I just added to the initial tutorial above. It's not allowing me to edit it. How do I do this?

143 Posts
Stef
5 years ago
1
Level 1

Hi every body, a special thank to Bonitto who drive me on right path to reach my goal...

My topic here is for two reasons :

The tutorial Bonitto need an update (as said above by himself). This is a very IMPORTANT things that an author can edit and modify his topic. I have follow his tutorial 3 times without any success before I found this topic on the forum. And here is another THANKS to Bonitto for having updated this topic :-)

The second reason is because I have follow and reproduced twice again this tuto without success. I needed to modify then some field and could make it work.

My case is similar to Bonitto's one, so I writte here what I had to do :

I have one content form for Courses and one content form for Professors.

My goal is to choose severals professors from Professors content on a Dynamic Checkbox in the Courses Content form so I can print them with Name, thumbnail and qualifications.

I reproduce the most of Bonitto tuto but had to do one change :

In the List & search form for Professors content, instead of adding the Dynamic Checkbox, i let the original "Core content type" and add the "Article ID" field. Then in my Courses content form, the parameters of the Seblod -> List field is : art_id=professor_dynamic_select (where professor_dynamic_select is obviously the name of my Dynamic Checkbox field in my Courses content form).

I spent some hours to find this workaround, but it finally did the trick. 

I'm open to any comment or advice for this workaround, but the fact is I couldn't make it with the exactly way of Bonitto...

1283 Posts
Bucklash
5 years ago
0
Level 2

Hi

I am interested in your answer but I couldn’t make sense of  your explanation :)

143 Posts
Stef
5 years ago
0
Level 1

Hi Bucklash,

I have made a video so maybe it will be more clear ?

Instruction :

Get a VIP membership