Skip to content

Commit

Permalink
store last search request for data publications in sessions and use f…
Browse files Browse the repository at this point in the history
…or back to search results link(s)
  • Loading branch information
lsamshuijzen committed Dec 13, 2024
1 parent 2440782 commit 0d72096
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 0 deletions.
3 changes: 3 additions & 0 deletions app/Http/Controllers/FrontendController.php
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,9 @@ public function dataPublications(Request $request)

$result = $client->get($SearchRequest);

// store current url for linking back to search results from detail pages
$request->session()->put('data_publication_active_search', $request->fullUrl());

if(!$result->isSuccess()) {
abort(404, 'ckan request failed');
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,14 @@
<div class="noMobileView_wideScreenDiv">

<div class="tabLinksParent">
@session('data_publication_active_search')
@include('components.tabLinks',[
'categoryName' => 'Results',
'routes' => array(
'Back to search results' => $value,
)
])
@endsession
@include('components.tabLinks',[
'categoryName' => 'Sections',
'routes' => array(
Expand Down
8 changes: 8 additions & 0 deletions resources/views/frontend/data-publication-detail.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,14 @@
<div class="noMobileView_wideScreenDiv">

<div class="tabLinksParent">
@session('data_publication_active_search')
@include('components.tabLinks',[
'categoryName' => 'Results',
'routes' => array(
'Back to search results' => $value,
)
])
@endsession
@include('components.tabLinks',[
'categoryName' => 'Sections',
'routes' => array(
Expand Down

0 comments on commit 0d72096

Please sign in to comment.