• Resolved slotigork

    (@slotigork)


    Let’s say I have a pod called Project. A project can have one or two authors, these are at the moment assigned to the fields Author 1 (required) and Author 2 (Optonal). For each author there needs to be 1 corresponding opponent, so 2 authors requires 2 opponents, while 1 author only requires 1 opponent. These are assigned to the fields Opponent 1 and Opponent 2. The name of the Project is the post title.

    I now have another pod called Presentation. Presentations requires a date, a project name and a place. It can also have 0 to 1 presentators assigned to it and 0 to 1 opponents assigned as well.

    What I now want to achieve is that want to connect a Project to a Presentation. Let’s say that I choose the project name for the Presentation through a relationship field, related to the post_title of my Projects. Would it be possible to then autopopulate the Presentator field with Author 1 and Author 2 and similarily autopopulate the Opponent field of the Presentation to be autopopulated with Opponent 1 and Opponent 2 from Projects?

    • This topic was modified 6 years, 4 months ago by slotigork.
Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Contributor Jim True

    (@jimtrue)

    Since you’re managing all of the Authors and Opponents through your Project post type, the relationship field from Presentation to Project would be what you would display the Author and Opponents through.

    Relationship fields aren’t actually to the ‘post-title’; they’re to the post ID of the Custom Post Type that the relationship is pointing to. You have access to ALL the fields, including the relationship fields in that other post type. So in this case your relationship field from Presentation to Projects gives you access to all the fields in the Project you selected, including the relationship fields for Authors and Opponents, so you can easily display those, if that’s what you mean by ‘auto populating’. It’s auto populated, because it’s connected through the relationship. It’d be the same thing if you had a Speaker who’s giving a Talk and you put it on the Event Schedule. The Speaker is populated from the Talk post-type. The Talk is what’s selected to connect to the Event Schedule.

    If you mean something else, please specify.

    Thread Starter slotigork

    (@slotigork)

    Hi Jim,

    thank you for your fast answer.

    Since you’re managing all of the Authors and Opponents through your Project post type, the relationship field from Presentation to Project would be what you would display the Author and Opponents through.

    In my case, though, I want Presentator from Presentation to be able to display options from both Author 1 and Author 2 since every author needs to have their own presentation, the same goes for Opponent as well.

    And yes, excuse me. When I say autopopulate I of course mean display. Thank you for your help!

    Plugin Contributor Jim True

    (@jimtrue)

    It might help if you back-up and get out of the Pods Interface for a bit and actually discuss the real-world solution you’re trying to automate. I think you’ve got a planning data structure problem which is giving you a UI issue because you have presented your data in a way that is incompatible to the solution you’re trying to solve. Or in other words: an XY Problem (https://xyproblem.info/)

    Plugin Contributor Jim True

    (@jimtrue)

    Also if possible, try to stay away from ‘let’s say we have a Pod A, etc.’ types of descriptions. Please use real world example as that’s easier to help you build a model around. Thanks!

    Thread Starter slotigork

    (@slotigork)

    Thank you for your patience Jim!

    This is what I’m trying to accomplish:

    I’m building a website for a university program. On this webpage, students must submit their master thesis. A master thesis can be written by either 1 or 2 authors and depending on the number of authors, there has to be an equal number of “opponents” AKA “external examiners”. I have created a pod for this which I call Project. The authors are of course decided as soon as the project is started and the opponents/external examiners can be decided at any point in time (as long as it’s before the actual presentation of said thesis).

    I also want to be able to announce free time slots were students then can present their master thesis in front of their supervisor, an external examiner and anyone else that might be interested. I’ve created a pod for this as well called Presentation. I want time slots that have no authors assigned to it to be presented under a header called “Available time slots” and as soon as an author has been assigned to it, I want the pod to be displayed elsewhere under a header called “Upcoming presentations”. This pod contains Presenter (one of the authors) Opponent (one of the external examiners), a date/time and a place.

    What I need help achieving is the following:

    Students register a master thesis.
    6 months later, one of the authors decides which of the available Presentation times that suits them the best and sends in a booking request.
    Said master thesis is manually assigned to a Presentation, as well as one of the authors and one of the opponents.
    Repeat for author 2 (if there is one).

    I want this to be as easy as possible to do from the WordPress admin panel. Once a booking request has been sent to the webmaster, he or she should be able to choose from the master theses yet to be assigned a Presentation. I then want to be able to choose one of the authors as well as one of the opponents/external examiners to be linked to this pod as well.

    I understand that I might be back at the XY Problem, although I hope I included enough background information this time to make it more clear what I actually want to accomplish here.

    Plugin Contributor Jim True

    (@jimtrue)

    Well, you’re still dealing with authors multiple select and examiners (opponents) as multiple select. Making the numbers of them ‘match’ is really something your admin person would need to keep track of. I don’t think you’re going to be able to do most of what you’re wanting to do ‘workflow’ wise without custom coding, since most of that decisioning can’t be made until the Thesis has a booking request.

    Ideally, your booking request would include in the header the details about the thesis and it’s authors. Then the only thing you’re actually doing is just adding the opponents at that point. You’re not changing the thesis; it’s already been properly registered in the system. All you’re doing is taking the booking request with it’s linked thesis (and the details regarding it, including its authors) and just assigning who else will oppose it and sending out the notices. Not that complicated. You’re not ‘populating’ anything. The ‘booking request’ owns the presentation date/time and opponents and a link to the thesis and it’s original authors.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Connect two fields from a pod to one field of another’ is closed to new replies.