Skip to main content

All Questions

Tagged with
Filter by
Sorted by
Tagged with
0 votes
1 answer
47 views

How to switch template for search results without using views and display modes?

I want to show my Drupal 10 Solr search results in either grid view or list view. I set this up using Views and Display Modes, and I have icons on the page which simply link to the URLs of the ...
Lemmy's user avatar
  • 201
-1 votes
1 answer
208 views

How to display default drupal search block in twig template

In twig_tweak module before version 2 (for Drupal 8) I could place the following code in my page twig template and it would work: {{ drupal_block('exposedformsearch_contentpage_1') }} This would ...
user5013's user avatar
  • 1,497
2 votes
2 answers
1k views

How do I render search block form in theme template?

I've customized the search block in "block--search-form-block.html.twig" and it works using block layout on Drupal 9. Is it possible to render the Search Block directly in page.html.twig? I'...
CocoSkin's user avatar
  • 891
0 votes
1 answer
262 views

Remove dots ( ... ) from default search results descriptions ( snippet )

I want to remove dots from search results items descriptions to search result page ( Default Search ), i have used Drupal default search for the search result page so how to remove the dots from the ...
Hims V's user avatar
  • 103
0 votes
0 answers
18 views

Seach Page Split into Form Block & Results Block

I already created a search view like /search it is giving form and results finely but Views UI is disabled in my server . So i want to split this search page into 1) A block which contains a search ...
user3463733's user avatar
0 votes
1 answer
949 views

How to override the default search block and make a button with Font Awesome?

I want to override the default search block of Drupal and create a button like the image below: However, I do not know how to do it. I have tried using hook_form_alter as well but it is not working: ...
John Brown's user avatar
0 votes
1 answer
755 views

Ajax loader when facet is selected

When we add a facet block to the page, a filter is selected and the page starts to load the results. However there is no loading icon or indicator the change is being applied. When we check the page,...
usernameabc's user avatar
  • 2,768
0 votes
1 answer
159 views

Search info_split is empty

I need to customize the search results of a drupal 8 (8.7.0 currently) page a bit and need the node_type for this. According to search-result.html.twig, this should be stored in info_split.type, but ...
Andreas's user avatar
  • 412
1 vote
1 answer
3k views

How to add pagination to programmatically rendered search result template

I am trying to implement the pagination in drupal 8 custom page. I have a custom array which I am rendering using theme, I need to add pagination for it. $internal_result = array_merge($...
sneha.kamble's user avatar
0 votes
1 answer
160 views

Facet API: grouping indexed values into several drop-down facets

I have an indexed field which contains values in such a form: CPU: Intel Core i5 CPU: Intel Core i7 ... Memory: 4 GB Memory: 8 GB ... Video card type: Integrated Video card type: Nvidia ... I would ...
VLaci's user avatar
  • 1
1 vote
1 answer
162 views

Add Last changed date to search results

I'm trying to override the search--results.html.twig file. And it says i can use info_split.date to render the dates. But when I try {% if info_split.date %} {{ info_split.date }} {% endif %} ...
Arthur Baghdasaryan's user avatar
0 votes
1 answer
357 views

Drupal 7 Custom Search Result Page

I am trying to create a custom page that display my resuslts which I receive after I search for a post. I am having no luck, I am a total begginer in drupal 7, I googled and looked around here but I ...
WSW's user avatar
  • 1
0 votes
1 answer
603 views

Having fatal error when rendering search block in page.html.twig [duplicate]

I'm using Bootstrap theme on Drupal 8. How can I print the default search block form in page.html.twig? Nov 22,17 @9am Update my question for @No Sssweat and @Ramdas Gaikar I have tired this before ...
CocoSkin's user avatar
  • 891
0 votes
1 answer
66 views

Apply multiple Content Type filters to Search Block Form in hook_form_alter()

I'm trying to figure out how to apply multiple content type filters to the search results of the Search Block Form (not the normal search form). I've successfully filtered by current language and ONE ...
ProGrammar's user avatar
1 vote
3 answers
1k views

Remove search form from search result page in Drupal 8

What's the best way to remove the search form from the search result page in Drupal 8?
scuttle-jesuit's user avatar
0 votes
1 answer
63 views

How to remove "Submitted By" data from google search engines in drupal7?

How can I prevent showing of Submitted by username information on google search result pages. I looked into some of the answers but I am not sure those solutions will remove from google search. I am ...
Suraj's user avatar
  • 884
0 votes
1 answer
104 views

how to show teaser view of my content types in search result page in drupal 7

I have customize my teaser view of my content types. Now i want to show that teaser view in search result page also. How can i do this? If anyone can give me a example with code will great help.
Akila's user avatar
  • 1
-1 votes
1 answer
346 views

Compare views.total_rows in twig file [closed]

Original Code: <div class="our-story search-query"> <div class="container"> <h1>Search Results</h1> {% if keysearch %} <p>{{ view.total_rows }} results found ...
Pranay Agarwal's user avatar
4 votes
1 answer
1k views

How do I find the search block form ID?

I added some search block in my theme, and I placed each of them in a custom place. I want to edit each of theme by using function hook_form_FORM_ID_alter for this purpose. Provide a form-specific ...
Mojtaba Reyhani's user avatar
1 vote
1 answer
31 views

Print search field in template file

I need a search field to "pop down" under a search icon ({# Search icon #} in sample code) in my template file. But how do i print the search block directly into a template file? I want it to be in ...
Mike's user avatar
  • 33
0 votes
2 answers
782 views

How to display the pager on top and bottom of a custom search results page?

I have used the core Search Page functionality in Drupal 8 to built a search engine on my site. The pager is displayed at the bottom by default. How can i display the pager on the top also? Note: I ...
d8ninja's user avatar
1 vote
0 answers
475 views

Add bootstrap css class 'list-group' to Drupal facet class js-facets-checkbox-links

I want to theme the Drupal facets into the Bootstrap theme. 1) How do I add a bootstrap css-class list-group to the existing facet class js-facets-checkbox-links. So I get: <ul data-drupal-facet-...
meez's user avatar
  • 1,333
4 votes
1 answer
3k views

Theme search block [duplicate]

I want to theme the default search block to a bootstrap search bar. When I create the searchbar in html it looks like: <div class="input-group"> <input type="text" class=...
JimmyD's user avatar
  • 410
0 votes
1 answer
611 views

Customize Search Form Block Text [duplicate]

I'm attempting to customize the search form block. I'd like to be able to change the search submit button, by either changing the text, or turning it into an icon and other various changes. I ...
Amy's user avatar
  • 5,803
2 votes
2 answers
287 views

Render Teaser Image in search block using Twig

I am trying to render the teaser image in my search block using twig. For my views page for rending the articles i am using this: <div class="img-container" itemscope="" itemtype="http://schema....
Dragu Alexandru's user avatar
0 votes
1 answer
98 views

How can I move the location of the advanced search form?

This has been giving me troubles for some time now. I am in the process of changing my search results page on my drupal 7 site. I have modified both the search-result and search-results template files ...
John Paschal's user avatar
1 vote
1 answer
129 views

Customizing Search File Attachments result page

I'm using search_file_attachments module for my search, And also Search combine module to show all the results in one page. In the search results page, I like to maintain a structure. I need to show ...
batMask's user avatar
  • 380
7 votes
3 answers
6k views

How to customize the default search block form template?

How can I customize the default search block form template, I now use below template to display a search form block, but this code doesn't allow me to edit and customize each part of this form ...
Mojtaba Reyhani's user avatar
0 votes
0 answers
31 views

Template Content is Ignored by Solr

We have content inside of D7 template files for pages that are heavily styled—cases where a Body field just doesn't make sense. A front-end developer writes the page like a normal HTML page, and the ...
Wray Bowling's user avatar
2 votes
1 answer
1k views

Customize Search Result Snippet to use Teaser

I would like to customize the output of each search result item printed on the search result page. Right now it automatically prints a portion of the content of each item, but I'd like more control. I ...
Amy's user avatar
  • 5,803
0 votes
1 answer
5k views

Twig template for search results page

I'm attempting to create a custom template for the search page located at 127.0.0.1/search/node I've created a template called search-result.html.twig in my theme/templates folder which allows me ...
Amy's user avatar
  • 5,803
3 votes
3 answers
1k views

How to show Search API search box? No block available, nothing from <?php print render($search_box); ?>

I'm updating a site to use Search API (with Search API DB) instead of the built-in search module. I've set up my Search API server and search, indexed everything, and now am just trying to replace the ...
user56reinstatemonica8's user avatar
4 votes
2 answers
2k views

Is there something equivalent to template_preprocess_search_results()?

I just realized that template_preprocess_search_results() function has been left out in Drupal 8 for some reasons, although template_preprocess_search_result() (for single results) is still there. I ...
Henkealg's user avatar
  • 629
4 votes
2 answers
1k views

Change markup shown before the search result

How do I change this markup from my .theme file? Line 119 and following in core/modules/search/src/Controller/SearchController.php contain this code. if (count($results)) { $build['...
Patrick's user avatar
  • 51
0 votes
1 answer
26 views

Restrict search results to only documents user can see

In my application, I have a content type called resource. In the resource content type, I have an entity reference that defines which roles should be able to view that resource. When somebody is ...
farjam's user avatar
  • 237
0 votes
1 answer
77 views

Theming views-exposed-form search block same like normal Drupal search block

On this page, top-right you see a custom views-exposed-form search block. How do i theme this, so it has the same classes and HTML structure as the one below (default Drupal search block)?
meez's user avatar
  • 1,333
3 votes
1 answer
77 views

How to display the user registration or profile field on the search page?

How can I render/display user profile or registration field on search result page (user search)?
Adeel Nawaz's user avatar
3 votes
1 answer
81 views

How to display the user picture on the search page?

I want to show the user picture on the search page. Currently only its show the user email or name, but I want to show the user profile picture. How can I do that? Note: the search page is about the ...
Adeel Nawaz's user avatar
0 votes
1 answer
1k views

Change appearance of search form [closed]

I want to change the appearance of the Drupal 7 search form. I used this code in my preprocess-html.inc file for my Omega subtheme. It didn't work. How do I assign html classes to divs within the ...
user55305's user avatar
1 vote
0 answers
56 views

how to add custom classes and div to drupal search form.. i want to change complete layout of the block [duplicate]

I want to set following HTML layout in my search form. <div id="sb-search" class="sb-search"> <form> <input class="sb-search-input" placeholder="Enter your search" type="search" ...
user3837266's user avatar
1 vote
1 answer
184 views

Drupal Search API Placeholder && Front Page?

I'm trying to get some placeholder text working for the Search API form, but have a different placeholder on the front page. Here's what I have so far which does work everywhere... function ...
Jeff's user avatar
  • 93
1 vote
0 answers
28 views

Template file in admin theme not looked for in admin theme

As documented here, I've created a custom filefield source that gets images from Apache Solr, and I'm using this in conjunction with the Insert module. I wanted to add some additional markup for ...
wonder95's user avatar
  • 1,219
1 vote
0 answers
587 views

Modify search result (Display Suite search)

Second day and I don't see solution for my problem. I want to modify the output of a single search result. Yesterday, after ~8h (?) I understood that search-api-page-results.tpl.php overrides ...
RustBeard's user avatar
0 votes
1 answer
36 views

Returning code in views search tpl but ONLY if user clicked 'search' button and results were returned

I have a Views-based search page on my site. I've created a views-view-search--tpl.php file to customize the order of elements on the page. I have a specific block I'd like to return but ONLY if a ...
Sage's user avatar
  • 2,463
1 vote
2 answers
928 views

How to redirect search result page in drupal

Here, I am working in drupal Commons plugin. I already customized search form in that drupal header.Here i include modify search form in custom theme: function mytheme_form_alter(&$form, &$...
VIVEK-MDU's user avatar
  • 147
2 votes
0 answers
29 views

Search text field shifts down to new line in Nav block

I enable the search module "core module" and then I place the search block in the Navigation region of my Bootstrap subtheme. In Firefox it renders it correctly. placing it just to the left and in-...
evangelo's user avatar
1 vote
0 answers
58 views

Search block in fixed bar issue

I've added the search block to my fixed navigation bar at the top of the page (the nav bar is fixed when you scroll the page). The problem is that searching for the term leads to no where. When I ...
StoryTech's user avatar
1 vote
3 answers
286 views

How to make custom template for search results

I have developed a custom search module that is working perfectly. Currently I am using the existing "search-results-tpl.php" and "search-result-tpl.php" for showing search results. But I want to ...
WaQaR Ali's user avatar
  • 1,706
1 vote
0 answers
22 views

Search Results Templates Strange Cacheing Behaviour

I've been trying to resolve an issue with my search results templates. There are two scenarios that I could really use some help with understanding: I have no search result templates inside my theme,...
mikrokosmonaut's user avatar
2 votes
2 answers
1k views

Using orderBy correctly with hook_query_alter

I have a hook_query_alter function that I'm using to edit my search.module results. It works ok so far. However, I'm having trouble adding an orderBy condition that I need. Here's the SQL I want added ...
Sage's user avatar
  • 2,463