top of page
Writer's pictureEymen Elkum

Link Multiple Pro Many to Many

Hi friends,


Today I will explain how you can use our extension "Link Multiple Pro" with many-to-Many (n:n) relationships.


In this article we assume the following entities Order & Product, and we need to add link n:n between them.


Step 1:

Create the middle entity manually.

Dont create n:n relationship directly using the entity manager

You can name this middle entity any name but we prefer one of these patterns: - OrderProduct (I will choose this name) - OrderItem - OrderProductItem - OrderProductMiddle

To make this more real we will add 2 fields to the middle entity: - Price - Quantity


Step 2:

Go to #Admin/linkManager/scope=OrderProduct (OrderProduct/relationships) add these two links: - Order has many OrderProduct - Product has many OrderProduct

Step 3:

Go to: Admin > Entity Manager > Order > fields > orderProducts:


#Admin/fieldManager/scope=Order&field=orderProducts


In the fields options do these:

  1. Enable form

  2. Select List Small layout or just fill the next input with the fields you want to display on the list. NOTE: if you have "Layout Pro" I prefer to create a new list layout and select it here.

  3. Here is the most important step set the "Middle Link" to "Product".

  4. Other settings are optional

  5. Save and add the orderProducts field to the Order detail layout.

  6. add price & entity to the OrderProduct selected list layout (Optional).

  7. You are done!


 







1,426 views0 comments

Recent Posts

See All

Comments


bottom of page