trilbymedia / grav-plugin-flex-objects

Powerful and supremely flexible object support for Grav
MIT License
40 stars 10 forks source link

Flex object relations #93

Open stephan-strate opened 3 years ago

stephan-strate commented 3 years ago

The README.md / documentation says:

Flex objects can have relations to other Flex objects with few lines of code defining the relation

Is there any example or starting point for defining relations between flex objects?

mahagr commented 3 years ago

https://github.com/getgrav/grav/blob/1.7/system/src/Grav/Framework/Flex/Traits/FlexRelatedDirectoryTrait.php

You need to create your own classes and use the getCollectionByProperty() method to get the objects. You also need to create form fields for admin to list the objects, if you want to create relationships in admin.

phmg701 commented 2 years ago

Hello, it would be very helpful just having a single example on how to create a relation between flex objects and how to manage them in Admin Plugin. Flex Objects are very powerful, and documentation would help unleash their full potential. Thanks!