Support » Plugins » [Plugin: Pods 2.2] permalink from wrong record?

  • Hey all,

    I’ve been working on my dragon cave experience site again. I’m pulling the data in a pod page now and that’s working pretty good. However, I’ve encountered one small problem. When displaying the father’s name of the dragon with a link, it’s not the link from the father, but from the mother. This is an example of what I’m working on. The first part is a simple display of all the data. In the second part you can see my tests. As you can see with the tests for the father, the name of the father is displayed correctly. However, when I tested to get a link with the name, I got the link from the mother instead of the father. Here’s the code that has to do with the subject. I haven’t copied the entire code, since it’s rather long. I’ve left out the table which simply displays the data and only included the table with the tests.

    I hope someone can explain why the mother’s link is used as the father’s permalink instead of the correct link, cause I’ve been going over the code so many times I don’t see it anymore.

    Also, I’ve checked the database and the permalink from the father is correct in the database. That’s why I really don’t understand it.

    I’ve posted this in the Official Pods forum too. I’m posting it here too because I hope the more people see it, the better a chance I have of someone knowing the cause of the problem and the solution.

    Thanks for the help!

Viewing 4 replies - 1 through 4 (of 4 total)
  • Are the dragon father / mother fields relationships? If so, try using as the field reference that you’re passing into the new Pod() instance.

    Yep, Father and mother are relationship fields. Both are in the dragons pod. So basically, I’m using three separate information records from 1 pod.
    I’ve tried your solution and this works perfectly!

    Do you think it will work too when multiple names are entered in the relationship field (partners, children)?

    Thanks again for all the help!

    If multiple are set, you should be getting an array of IDs back. You’ll want to use some PHP to work with the data however you see fit.

    Thanks for the excellent help, Scott!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘[Plugin: Pods 2.2] permalink from wrong record?’ is closed to new replies.