2

I've imported Wordpress comments into a post type called 'comments' in a section called 'interactions'. I have the slug stored in 'relatedPostSlug'.

How would I relate the 'relatedPostSlug' to the actual posts with that slug?

  • I have said 'afterwards' in the title because these items already exist. – Shane Hudson Sep 7 '14 at 13:28
2

If you want to leave the data as-is, you could just fetch the “related” interaction entries like this:

{% for interaction in craft.entries.section('interactions').relatedPostSlug(enry.slug) %}
    {{ interaction.comment }}
    ...
{% endfor %}
  • Nice one, that looks good (though I presume less efficient?) Thanks a lot! – Shane Hudson Sep 7 '14 at 15:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.