I have a view with display mode set as full content.
I am trying to get the exposed input value of that view in my node content when displayed in that view.
So I have created a preprocess function like the below which I think is correct, the same node type and view mode I am rendering in the view.
function mytheme_preprocess_node__node_type__view_mode(&$variables) {}
I am not sure at this point whether I need to call the view or if I can just check if the view matches my Id so I try comparing view and assigning the exposed filter value,
$view = views_get_current_view(); if($view_id == 'my_view'){ $variables['exposed_filter'] = $view->exposed_input['filter_name']; #or $variables['exposed_filter'] = $view->get_exposed_input['filter_name']; #or $variables['exposed_filter'] = $view->exposed_raw_input['filter_name']; }
But when I put {{ exposed_filter }} in node–node-type–view-mode.html.twig it does not render anything.
How can I pass the exposed filter value to the content display within the view? Thanks