This project is read-only.

Sample connector example not working

Jul 7, 2011 at 12:00 PM

Hi There,

I am trying to get the sample connector example working on my Orchard project. I have created a Caterory and a Product content types. I have then attached the sockets to both of these types. In order to display multiple products under a category, I have created a Product to Category connector. Within the admin, I am able to add products to a category but when I view the category in the UI, I dont see the products listed under it. Is there anything else that needs to be done? Do I have to modify the drivers or change any settings to make it work?

Also, is there any way of restricting what items gets assigned to the category? At the moment, we end up seeing all the different content types in the dropdown while I want to see only the Product content type. Is some coding required to make the connectors work?

Jul 12, 2011 at 3:36 PM

What you need to do at the moment is also create a "CategoryToProduct" connector, and then in the connector settings you can specify the Inverse Connector as "ProductToCategory" (and for ProductToCategory specify CategoryToProduct as the inverse). Once you have the inverses set up, you'll automatically get the relationship both ways when you create connections - that allows the products to display under the category, as well as categories to display under the products. It's a bit of a long way round I know, I want to make this easier in a future version, although it allows very fine-grained control of how the displays are set up depending on which end of the relationship you're looking at.

On the Connector settings you can also specify a list of content types that are allowed, this will limit the content types that get displayed in the UI.