New answers tagged

5

You can achieve that with the search plugin used by the search page entity with the node_search id. use Drupal\search\Entity\SearchPage; // Default is the node_search page. $id = \Drupal::service('search.search_page_repository')->getDefaultSearchPage(); $defaultSearchPage = SearchPage::load($id); $searchPlugin = $defaultSearchPage->getPlugin(); $...


0

You can try the following. Add in your JS file: $(document).ajaxStart(function(){ $('#ajax_loading').show(); }); $(document).ajaxStop(function() { $('#ajax_loading').hide(); }); Add the HTML in your page: <div id="ajax_loading" style="display:none"> Add in your CSS file: #ajax_loading { position: fixed; left: 0; right: 0; top: 0; ...


0

Thanks to the help I got I manage to get it working function hook_preprocess_views_view_field(&$variables) { $view = $variables['view']; $field = $variables['field']; if ($view->storage->id() == 'saa' && $view->current_display == 'page_1' && $field->field == 'fid') { $fid = $variables['output']; if (!is_string($fid)){ $fid ...


0

$file should be instance of Drupal\file\FileInterface but in this case $file is null so you should check first on $file something function hook_preprocess_views_view_field(&$variables) { $view = $variables['view']; $field = $variables['field']; if ($view->storage->id() == 'saa' && $view->current_display == 'page_1' && ...


0

I was experiencing this bug only when indexing. Which was making me think it's due to misconfiguration. Drupal\search_api\SearchApiException while trying to index items on index main: Solr endpoint https://mysite:443/solr/main/ unreachable It turns out, this error can happen when it actually has reached the server, but you try to do something that ...


0

In Solr Host field, you can try entering value: 127.0.0.1 and for Solr path you can leave it empty.


Top 50 recent answers are included