PrevInSection following tag instead time

I just started playing around with HUGO. Watching Tutorials and reading the documentation.

I have played around with tags. I got a list of tags (single.html):

{{ with .PrevInSection }} vorheriges: {{.Title}} {{ end }} {{ with .NextInSection }} nächstes: {{.Title}} {{ end }}

This works fine.

Now I would like to browse through the list, but instead of PrevInSection the next content with same tag.

Is there a way to do this?

Thank you in advance for helping me.

You might use the snippet at Previous in Series and Next In Series links.

Thanks maiki for the hint.

It seems, that I am struggling before your hint comes in action…

I have several posts:

post1: tags: car train plain
post2: tags: car train boat
post3: tags: car
post4: tags: plain
post5: tags: train

Hitting the taxonomy.html for train I shall have listed the following posts:

post1, post2 and post5

Choosing post2 from the taxonomy list will jump to the single.html

My choosen tag (train) will be listed among the other (car and boat) in the single.html

Browsing now form post2 further. I do not have any more my chosen (taxonomy list) tag but all included in post2 (car train and boat). Browsing now with Previous/Next will bring post1 resp. post3. Assuming the posts are all in the above order created.

As a newbie I am not sure weather I have misunderstood something. Is there no connection between the taxonomy.html and single.html expect the link? Is there a possibility to send a parameter from the taxonomy.html to the single.html?

Thanks in advance for a reply.

The taxonomy template solved my problem by paginating page by page. Single page, in this case, almost obsolete.