• Resolved maiki

    (@maiki)


    I’ve of a mind to create a mind mapping tool for myself, so I will give a simple example, and then I was hoping we could discuss options available. ^_^

    This example is going to sound mundane, but I am keeping it such to explain the goal, so don’t worry about alternate ways of accomplishing this particular issue.

    Say I write reviews for books, for a bunch of different places, like a blog, a magazine and a newspaper, and probably many other places. I’d like to have a CPT for books I’ve read, and a CPT for locations I will review it.

    I can create that okay, I can create a relationship between books and review locations.

    The next step is that I would like to keep track of where I’ve made the reviews. For instance, I get a book that I am going to review for the magazine and the newspaper (and only those two). But they are different reviews, so I will do one at a time. When I am done with one, I’d like to make it as done. How would I go about doing that?

    We can avoid front-end editing, since that is abscracted, and I don’t actually care.

    What I am thinking is of somehow passing the array of related posts to populate a list field (I’ve been doing a lot of work in Gravity Forms, and that is what folks ask about all the time, because they have hooks and filters for that kind of thing, hence why I phrased it like that; I don’t really know what I am talking about, because I’ve never added any filters for Pods or CPT processing).

    Another option I considered is having two separate relationship fields, one for possible review locations and one for completed reviews, and playing with the output template to produce something like a list of all review locations, but add a class to the finished ones. Again, no idea how I am gonna do that, but I’m learning.

    For the latter idea, if would still be useful to restrict the second relationship to only fields chosen in the first relationship field.

    Whatcha folks think?

    https://www.ads-software.com/plugins/pods/

Viewing 5 replies - 1 through 5 (of 5 total)
  • Thread Starter maiki

    (@maiki)

    A possible front-end solution would be to remove a relationship in one field and add it to another in one process.

    Poking around on the pods.io fora, I think what I am looking for in the original post is the ability to dynamically populate one relationship field with the options in another, and from the responses there, it doesn’t seem possible. Ideally, I could use a Customized WHERE statement that would limit the results to the choices in the other field.

    Looking forward to other ideas. ^_^

    Plugin Contributor Jim True

    (@jimtrue)

    Quite a bit of information in this question and you seem to be focusing on how to handle the end user/output prior to working on the database design first. I’ve found with working in Pods (and in any relational database design), you save yourself a lot of headache by creating something in the Pods admin that works PRIOR to working on how to make it work for the end users. Get Pods and relationships built first.

    Would you consider Books to be a 1-M relationship to Reviews? ie, you can only have ONE book, but you can have MULTIPLE Reviews for that one Book and the Reviews are really tagged by WHERE you’re publishing the Review, right?

    The Reviews table would have the ‘completed’ checkbox field (meaning that you’d completed that review) and you can query to show which are completed and which are not completed.

    If you’re looking at the best ways to handle output or user interface for marking reviews completed, check out the Pods Form documentation:

    https://pods.io/docs/code/pods-form/

    You might also want to check out the Pods Gravity Forms Add-on in Public Beta:
    https://github.com/pods-framework/pods-gravity-forms

    Thread Starter maiki

    (@maiki)

    Well, in the first post I said:

    We can avoid front-end editing, since that is abscracted, and I don’t actually care.

    I am not concerned about the front-end process, because this isn’t for other folks, just me.

    I’ve built dozens of CPTs, with various field combos to emulate what I am trying to do, but I don’t know how to mark the related field’s results as “done”. In my initial description, I tried to explain what others in the forms call populating one field with the results of another, which is apparently not something Pods does via advanced field settings.

    You wrote:

    Would you consider Books to be a 1-M relationship to Reviews? ie, you can only have ONE book, but you can have MULTIPLE Reviews for that one Book and the Reviews are really tagged by WHERE you’re publishing the Review, right?

    I don’t really understand what you mean. Books and reviews would have a many-to-many relationship. I am not sure why you emphasized the words “multiple” and “where” with caps.

    I can have a field that is a list of checkboxes for related fields, but that isn’t useful to me, because it shows all the posts. What I want is a list of checkboxes for a subset of posts, which are already related, because then it is useful as a todo list.

    If have 50 review locations, I don’t want to have a list of 50 checkboxes. For a book, I may only want to write two reviews. So first I choose which review locations (2 of them), and then my review checklist will only have those two options to be checked. Hence, restricting one field by the choices in another.

    This has nothing to do with the front end, except it is possible to rewrite the output to get the results I am talking about, according to a couple of cases in the pods.io fora.

    Thread Starter maiki

    (@maiki)

    I am not too functional with PHP, but one way I realized I could accomplish this is with two fields, say autocompleted related fields, where the first one is the possible review locations, and the second are the accomplished locations. Then, I can compare the two arrays of results on the output, and show the results in both fields as completed (on the todo list), and the fields in the first but the second as not completed (on the todo list).

    But it would be easier if I could just create two fields, and have the second field only show the results from the first field, obviously.

    Plugin Contributor Jim True

    (@jimtrue)

    My apologies Maiki for not responding sooner on this one and for any confusion in my first reply. I was trying to get a handle on the design of your data to better answer what you’re attempting to do on the backend.

    I come from a Database design background so I tend to frame my responses about Pods design in that format and that’s where the one to many and WHERE capitalized come from. They’re from Structured Query Language (SQL).

    So you’re not concerned about output at all, you just want to handle your workflow in the back-end admin side of the website?

    So it sounds like you have the following:

    Books, which is related to Reviews (which you can have multiple reviews) but only for the Locations where you want to do the Reviews. In this case, it sounds like in precedence, Books is first, Locations where you want to review is second and you’ll create Reviews for each Book & Locations as you complete the review, maybe change it from Draft to Published or something like that?

    Let me know if I’ve got the gist of what you’re looking for. I have a couple of ideas, that may or may not be able to handled completely in the admin side based on if I’ve captured your concept correctly or not.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Brainstorm: make a checklist from related posts’ is closed to new replies.