Recently Active Questions
88,144 questions
0 votes
1 answer
866 views
Change sort order for view when exposed filter text field submitted
I have a view that by default is ordered by date. It has several exposed filters one of which is for filtering by text (we use it as a search field). I'd like the view sort to change to Relevance when ...
3 votes
2 answers
5k views
Click on a day to create an event
I'm wondering whether it is possible to simply click on a Drupal calendar tile (month view) and be automatically taken to the page for creating an event. The only thing I've found that comes close to ...
0 votes
1 answer
486 views
Drupal Commerce - Retrieve cart value
I'm trying to create a popup notification on a route that shows the current cart value (subtotal) and notifies users to add $X.XX to receive free shipping. I have extended a route to add new ...
0 votes
1 answer
766 views
Reassign $view_mode using entity field passed to hook_entity_view_mode_alter()
I'm using baseFieldDefinitions to create my custom entity form. With gracious help here, I've been able to successfully generate a radio button on the form which lets the user select what view mode to ...
0 votes
1 answer
655 views
How to create a chart about a date range if some dates in this range are missing?
I use charts module Charts and I want to create a view that shows the stats from a date range. I have an exposed filter and this filter has a between range. I want to show all dates from values of ...
1 vote
1 answer
525 views
How to update one select element via Ajax when using node_add
I have just created a new content type called pieza_musical. What I just want to do is update one select element via Ajax depending on another select choice, a dependant select. I'm altering the ...
0 votes
1 answer
738 views
How to display the profile page in Modal window
By using ctools, i am able to display a form in modal window. Now i wish to display a page(the profile page) in modal window. Below is the sample code (call by menu page callback) to display a html ...
1 vote
1 answer
528 views
Upload Data From Excel Sheet to taxonomy
I have 4 Excel sheets like: First (35) Records: State Code | State Name Second (650) Records: State Code | District Code | District Name Third (6500) Records: State Code | District Code | Block ...
1 vote
1 answer
1k views
How to Unit Test Entity Reference Field Value
I have been tasked with writing a Unit Test for a method where I pass in a Node object, modify an Entity Reference field value, and then return a Node object. Since this is a Unit test, I am unsure ...
0 votes
1 answer
706 views
How to add a reset button to forms?
How do I add a reset button to a form? I have a form with a CKEditor and other fields, plus hidden fields. How do I reset the form so all fields are empty?
3 votes
4 answers
4k views
How to use entity form in pop-up window?
I have created a view, and there is one column named "forward to delete". I want to open an entity form in a pop-up after clicking on this link and get the node id of the clicked node so that I can ...
1 vote
1 answer
1k views
Block is not showing up in a custom taxonomy page template
I am using Drupal 7 I have a content type courses. I have a page folder in template folder, with courses.tpl.php file. When i go to courses page it is showing contents from courses.tpl.php. Issues is ...
0 votes
1 answer
742 views
Update script fails due to Service capacity
I am trying to update the core of my Drupal site. I neglected updates for some time and the update script had 19 updates pending. Apperently the update script tries to do all of this in one go, and ...
4 votes
2 answers
4k views
How to translate taxonomy terms displayed via an exposed filter in views?
I'm using the Views, i18nviews, and Entity Translation modules. All of my terms have already been translated using Entity Translation. In views displays, the translated terms appear in the correct ...
0 votes
1 answer
1k views
How to use t() function in controller?
I understand Drupal 8 ControllerBase implements StringTranslationTrait so we can use $this->t() in Controller class. But I found in Drupal 8 examples code, they setStringTranslation to use t() ...