We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 12181
    • 12 Posts
    Hello,

    so far modx has been a real joy to start out with compared to previous experiences in drupal and typo3.
    For the relaunch of a university department site the backend editors need to be able to manage structured entities (staff, lectures, students etc.) in addition to the unstructured website content.

    I dont want to ask you to do my work for me here, but before starting the implementation I wondered if the approach I consider here is maybe on the wrong track and modx does actually offer a simpler way to do this. So if you allow let me ask if the following complies to the "best practices" in modx so to say:

    1) n-m relations between entities matching page resources
    Staff members and courses both have an individual "detail page" on the site and can be related in an isResponsibleFor n-m relation.
    Therefore I had planned to create a page resource for each staff member and course assigning both types a custom template of type templateStaff or templateCourse with both templates containing a certain amount of custom template variables (e.g. email address for staff members, room number for courses). The isResponsibleFor relations would be set via a custom implemented TV input variable offering e.g. for a staff member’s "responsibleFor" TV all courses in a multi-selectbox (populated by the custom TV input variable querying the modx environment for all page resources using the templateCourse template).

    1b) Mandatory TV’s
    Is it possible to markup certain TV’s as "required"? In the above example e.g. a staff members email address? If there is no out-of-the-box way for this:
    Would implementing a custom validateEmployeeDetails plugin which is attached to e.g. the OnBeforeDocFormSave system event and checks whether certain TV’s have been filled in be the correct way to go?

    2) n-m relations between entities not page resources
    A third entity type students would not require a "detail" page. For this case I had planned to create Custom Manager Pages to enable a CRUD-style management area in the modx manager backend using a Custom Database Table in your 3rd Party Components. Relations to courses/staff could be added same as above via custom input TV’s on the course/staff TV tabs.


    Mostly I am worried if the implementation of custom manager pages along with the required ajax fields and xPDO schemata to manage the student entities might be overkill in some way.

    Thank you a bunch for your feedback here - it would be most appreciated smiley
    Hinnerk
      • 12181
      • 12 Posts
      Alright so the first part (1) worked quite nicely without too much hassle.
      So now I am still stuck whether implementing custom manager pages modifying data in modx-external tables utilizing a custom xPDO schema is necessary or whether modx manager fiunctionality can somehow be reused (maybe via a custom resource type?).

      Thanks a bunch for any input smiley