Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

New answers tagged

0

I solved it myself (that's a first and probably a last)! I'm sure this isn't the best code but it works and I don't know enough PHP to clean it up. I disabled all "No Results Behaviors" in the view settings. I'm using the hook_preprocess_views_view hook to count the number of results for each of my attachments. Only if all 4 === 0 will it print the correct ...


0

If you have access to the external database credentials, there is a module called views database connector that gives you access to an external database in views. I think it might be possible to configure a view to search through an external database with that module. UPDATE: Otherwise you might consider creating a rest export view, there are a ton of ...


-1

In Filter criteria you need to Add the tag (Taxonomy) fields to extract right values from views. Also remember to select expose this filter to visitors and selection type - Autocomplete. You can see attached screenshots below. I hope these will help.


1

Add the datasource (entity reference) as a exposed filter. Check the "allow multiple selections". Now, the user can add comma seperated tags (with autocompletion): Used search api 8.x-1.13 on drupal 8.6.16


0

For Drupal 8 I had to write custom properties to get my comments into the index. I followed this documentation https://www.drupal.org/docs/8/modules/search-api/developer-documentation/create-custom-fields-using-a-custom-processor And than queried my Entity in addFieldValues() Method. Like $object = $item->getOriginalObject()->getValue(); $...


0

I would enable the Facet API module first of all, which will give you the facet interaction with Search API. I would then point you towards a good, simple tutorial at https://medium.com/@swappyp20/creating-a-faceted-search-view-in-drupal-8-using-the-search-api-modules-2b2604ad37f4 Hopefully you should be able to sort it out from there.


0

VBO doesn't search, it only gives you the interface to select items in the Views results and perform actions on them. To construct the search you want you can use ordinary Views with the Combine fields filter filter, here's one video tutorial: Search across Fields in Views using Combine Fields Filter in Drupal 8, or use Search API for something more ...


0

Not sure you can do this with facets. Facets by definition show only options that exist in the current query results. There is no guarantee that a content_page type will be among the search results for a term. You may want to consider using an exposed view filter (the views_block_filter_block module lets you turn this into a place-able block). This ...


0

Goto http://YOURSITE/admin/config/system/site-information and under "ERROR PAGES " change "Default 404 (not found) page" to your search page. In this way, Drupal will redirect all 404 pages to the page that you have provided.


0

Alright, so I'm still not sure why the fields are empty, but they the keys are certainly there. Either it is a bug in the core, or some weird behaviour of my installations. I fixed it now manually by implementing the preprocess_search_result hook in mytheme.theme: function mytheme_preprocess_search_result(&$variables) { $variables['type'] = $...


0

This is often achieved using Views with a Contextual filter that pulls in the current node ID and uses it as the "parent" to find the "children" of that Entity Reference field. Here is a similar question/answer with all the steps how to set it up: List "ER Child" info on "ER Parent" nodes https://drupal.stackexchange.com/a/280876/52224 Using Views is ...


1

Use entityQuery to search for referenced entities. Let’s illustrate a couple of examples of querying for node entities using this object. A very simple query that returns the published nodes: function ecc_general_node_update(Node $node) { // Find the project for current client that are actives $query = \Drupal::entityQuery('node') ->...


0

Hey thanks for the reply, because of it I pushed a bit harder and tried a few more things and I got it working. My primary mistake was that I wasn't using the taxonomy term id as the value, I kept using the term name instead. Here is the code that I got working. $search_input => $form_state->getValue('search') $tax_field = 'field_taxonomy_name'; ...


Top 50 recent answers are included