Why would the bots not just crawl the pagination links?
Sep 28, 2020
7
Level 15
Livewire Pagination
When creating a custom pagination view, do you have any idea how I can add withQueryString() and page increment/decrement so bots can crawl it (google etc)
this is what I am using for my custom pagination view currently:
@if ($paginator->hasPages())
{{-- {{dd($paginator->nextPageUrl())}}--}}
@if($paginator->hasMorePages())
<div class="load-new-reply has-text-centered mt-15 mb-30">
{{dump($paginator->nextPageUrl())}}
<a wire:click.prevent="nextPage" href="{{ route('forum.index', ['page' => $paginator->currentPage() + 1]) }}" rel="next"
class="has-text-weight-bold">{{ $message }}</a>
</div>
@endif
@endif
While this works it doesn't allow for queryString so changing it to :
@if ($paginator->hasPages())
{{-- {{dd($paginator->nextPageUrl())}}--}}
@if($paginator->hasMorePages())
<div class="load-new-reply has-text-centered mt-15 mb-30">
{{dump($paginator->nextPageUrl())}}
<a wire:click.prevent="nextPage" href="{{ $paginator->nextPageUrl() }}" rel="next"
class="has-text-weight-bold">{{ $message }}</a>
</div>
@endif
@endif
Produces this URL in the href :
/livewire/message/forum-home?page=5
Which is uncrawlable, is there any way you can think of to provide the query string and get livewire to have the proper href's in the pagination links?
Please or to participate in this conversation.