Previous/Next button to next item in Matrix I've made a projects structure with inside a couple of projects. On the homepage people can fill in a matrix with either a project or a textblock.

I'm capable of looping through the detail pages in the order that they've been made in the Projects section. I can't however make them loop in the order the client orders his Matrix. I'm capable of finding the current detail page I'm on by using relatedTo(entry) however I'm uncapable of using getPrev / getNext. 

{% set source = craft.entries.id(2).first().projectList.type('project').entries.relatedTo(entry) %}

{% for collection in source %}

{% for project in collection.projectEntry %}

    &lt;p&gt;{{project}}&lt;/p&gt;

{% endfor %}

{% endfor %}


This returns the current project I'm visiting. Even when using getPrev(entry) or getPrev(source) in there it keeps on returning my current project instead of the prev/next
In order to get previous or next elements in Craft you have to pass the current criteria in the elements getPrev function. In your case

{% set criteria  = craft.entries.id(2).first().projectList.type('project')

{% set prev = collection.getPrev(criteria)  %}