• Hello,

    I’m using Posts 2 Posts to connect two custom post types, Songs and Charts, to create a ranked chart/list of songs (similar to the Billboard charts). Each time a song appears on a chart, it’s given a “position” between 1 and 100 (‘values’ => range(1, 100)). I successfully used connection metadata to set that up and add a “chart history” section for each song. Now I’d like to determine a few stats for each song:
    – its chart peak, aka the lowest number it gets on any chart
    – the number of weeks it charted, aka the number of charts on which it appears
    – on each chart, its position on the chart before it (so I have “last week”/”this week” figures)

    I imagine I could output an array of positions for each song, from which I could pull the minimum and a count, but I’m not familiar enough with PHP to figure it out and the wiki, while helpful elsewhere, doesn’t go into much detail on connection metadata. Any ideas on how to produce those numbers?

    If it’s necessary for a better understanding of my question, here’s a link to a test chart on my dev site: https://kurttrowbridge.com/kurtdev/charts/test-chart/

    Thank you for any help you can offer!

    https://www.ads-software.com/plugins/posts-to-posts/

  • The topic ‘Help using values as connection metadata’ is closed to new replies.