As Julian pointed, you need to pass that data somehow. If the only goal of sending different listpid
for creating different breadcrumb and you don't want to create multiplied resources because of SEO, you can use post-form trick instead of a common link as demonstrated in another answer to send hidden params with your fake link, your HTML markup would look like this:
.inline {
display: inline;
}
.link-button {
background: none;
border: none;
color: blue;
text-decoration: underline;
cursor: pointer;
font-size: 1em;
font-family: serif;
}
.link-button:focus {
outline: none;
}
.link-button:active {
color:red;
}
<form method="post" action="https://domain.tld/somepath/detail/object-name/" class="inline">
<input type="hidden" name="listpid" value="345">
<button type="submit" name="submit_param" value="submit_value" class="link-button">
Detail page
</button>
</form>
So your Fluid part would look like
<form method="post" action="{f:uri.action(action:'show', arguments:{object:object})}">
<input type="hidden" name="listpid" value="{listpid}">
<button type="submit" name="submit_param" value="submit_value" class="link-button">
Detail page
</button>
</form>
and you can get it in your controller's action with
\TYPO3\CMS\Core\Utility\GeneralUtility::_POST('listpid');
SEO doubts
When we're talking about SEO issues we should consider at least two aspects. First is that one mentioned in the previous part, so avoiding duplicated content with different URLs to the same single news, and this trick resolves it, however, using this we do not generate common links which can be read by search engines.
Keeping this in mind at list one of the List views (probably no. 1 in your case, because it shows all, non-filtered items) should NOT use form workaround and render normal links with GET
method.
This List should be also used as a fallback in the case when $_POST['listpid']
is unavailable, ie. because request is made from external pages, like Google, or another linking page.
Note: Actually this topic deserves separate question with seo tag. If someone wants to make additional research, feel free to add the conclusion in a comment and/or edit this part of my answer.
Alternative approach with JS
According to your suggestion there's another possibility, using jQuery for pure comfort, you can do it probably with vanilla JS if required. Maybe it's semi-solution for previous SEO doubts, but I'd rather not to
<!-- in HEAD section of your page if didn't include jQuery before -->
<script src="https://code.jquery.com/jquery-3.5.1.min.js"></script>
<!-- add the hidden form only once at the beginning -->
<form action="" method="post" id="fakeLinkForm" style="display: none">
<input type="text" name="listpid" value="0" id="listpidField">
<input type="submit" name="submit_param" value="submit_value">
</form>
<!-- Your links -->
<a href="http://domain.tld/article/foo" data-listpid="123">Foo detail page (from list 123)</a><br>
<a href="http://domain.tld/article/bar" data-listpid="234">Bar detail page (from list 234)</a><br>
<a href="http://domain.tld/article/baz" data-listpid="345">Baz detail page (from list 345)</a><br>
<!-- Paste the script in the footer -->
<script>
$("a[data-listpid]").on('click', function (e) {
e.preventDefault();
let $link = $(this), $form = $('#fakeLinkForm'), $field = $('#listpidField');
$field.val($link.data('listpid'));
$form.attr('action', $link.attr('href'));
$form.submit();
});
</script>