All Questions

Filter by
Sorted by
Tagged with
1 vote
1 answer
1k views

File field upload in modal/dialog

I have a custom content type with file field as one of the fields. For theming/UI purposes I should make this file field as clickable button. And only when user clicks on it, he/she gets modal window ...
0 votes
1 answer
1k views

How to use "IS NULL" and "IS NOT NULL" Operators in JSON API Collections?

I am creating an API with Conditions and Operators. For '=' and '<>' operators its working fine. But for "IS NULL" and "IS NOT NULL" operators the response is 400: Bad Request. {{URL}}/jsonapi/...
2 votes
1 answer
496 views

Override formatting for paragraph edit view

I have a paragraph type defined as two fields, which are Person and Role. I can customize the structure of the paragraph fine to view. However, I am stuck in editing how the form elements sit in the ...
0 votes
2 answers
1k views

How to prevent other roles from publishing content

I am new to Drupal. I am working on a website where I have 2 user roles: Site admin and editor. The site admin has all permissions. I want the editor to only have the permission to edit content but ...
1 vote
1 answer
1k views

How to Display Empty Fields in views

How do I Display empty fields in Views? Empty_Fields module does not work for me as there needs to be a custom text for it to display. I want to display all labels even if the fields are empty. How ...
1 vote
4 answers
2k views

How to change the markup for a field

I'd like to change the output from the field formatter view from the Field API. I'd like a cleaner markup without unnecessary tags. What's the best way to clean up field formatter view output? Many ...
0 votes
1 answer
483 views

Exposed filter value into the session and cookie?

I want users visit my site regularly. And I need to store their settings to session (cookie). These settings are: Views Exposed Filter on the FrontPage (like to hide materials from the black list ...
1 vote
2 answers
1k views

Using custom .tpl.php for fieldable panel pane view mode

I'm having a difficult time getting a view mode on an FPP to use my custom .tpl.php file. Here is hook_preprocess: function mymod_preprocess(&$variables, $hook) { $element = $variables['...
0 votes
0 answers
8 views

reCAPTCHA missing in webform

We have built a Drupal webform with ten pages, each containing one question. The last page includes both a question and a captcha. Users can check the captcha and submit the form. We are using Ajax ...
1 vote
2 answers
1k views

Programmatically change page orientation for Entity Print module

In many projects, some entities needs to be printed on LANDSCAPE format, others, on PORTRAIT. I was searching for an example or, maybe, a more precise way to implement a page orientation hook, but ...
0 votes
1 answer
621 views

NFS Directories between 2 Servers

I have 2 parallel Drupal Web Servers running (serving for one Drupal Instance together) and now i need to install NFS. My experience in multi Drupal Servers is, each Drupal Instance (Server) uses ...
2 votes
1 answer
742 views

ANDs within OrConditionGroups

I'm trying to use entityQuery in Drupal 8 to perform an "and" within an "or" group. A simplified version of what I'm trying to do is this: Query for all apples, oranges and bananas ...
0 votes
0 answers
21 views

I need to redirect Anonymous user to login page

I have a webform that is restricted to Authenticated user. The form is working as intended. When Anonymous user try I access the form they get The website encountered an unexpected error. Try again ...
12 votes
6 answers
6k views

Export/Deploy Drupal site/page to static? (no cache)

I wonder if there is an existing module that can help in the subject. I am not looking for a caching module (like Boost or Varnish), but a way to export my whole site (or only certain pages) into ...
2 votes
2 answers
2k views

Remove Admin Toolbar "Manage" item if User has No Access

I have created Tours for my users and allowed them to see the Admin Toolbar as a result. However, I have the following unpleasant toolbar: I would like the "Manage" item to be gone altogether when ...
1 vote
1 answer
567 views

How to update taxonomy term of a node using services

I have created a new node using Services 3 module successfully, the code is below { "type":"page", "title":"New test page", "taxonomy": { "tid" :"367928" } } Configuration: Drupal ...
2 votes
2 answers
1k views

How can I apply different templates based on taxonomy hierarchy?

I'm new to Drupal and I don't have extensive knowledge so I'm hoping I can get this question answered. I want the taxonomy pages of lower hierarchy to be displayed differently from the higher by ...
0 votes
0 answers
9 views

Views - Contextual filters with taxonomy

I have built a normal view with a contextual filter on a taxonomy term: This taxonomy term consists of 6 terms, with four terms the call of the view works without problems and with two terms I get ...
0 votes
0 answers
16 views

Migrating webforms from Drupal 8 to 9

I am trying to migrate webforms from a site running drupal 8.4 to 9 with the former's database as source. The source site has more than 1000+ forms, so I prefer to opt for the migration framework ...
2 votes
2 answers
1k views

How to conditionally change email content from Webform submissions [closed]

Reading the docs I can see that you can conditionally change the recipient of a webform email based on a field value, but that's not quite what I want to do. I want to modify the content of the ...
2 votes
1 answer
661 views

Create commerce product through web services

I want to create products using commerce services resource module. At this moment, I can create a product calling the resource .../product with POST, but It seems that It only creates a product ...
0 votes
1 answer
625 views

How do I print individuals fields in block.html.twig when is a node in a block?

How do I print individuals fields in block.html.twig when is a node in a block? The template is working fine. I can hard code some random text and it is displayed. I just can't display the field ...
9 votes
2 answers
860 views

Grouped Exposed filters radio buttons : one in two no value ticked. How to programatically force default button be ticked?

Some exposed filters (radio buttons) aren't systematically ticked when a view is displayed, causing an "An illegal choice has been detected. Please contact admin..." error message and No result found. ...
0 votes
2 answers
792 views

hook_views_pre_render -> how to access variables

I have a view of teasers, and would like to check the status of each node. Using hook_views_pre_render (in the template.php file of the theme), I can access: $view->style_plugin->row_plugin ...
0 votes
1 answer
527 views

Views filter criteria groups OR not working?

I have a view with FILTER CRITERIA set. I have three groups, each joined by ANDs, with the criteria within each group ORed. The final group are two taxonomy terms, meaning I want my query to return ...
-4 votes
1 answer
41 views

How can re-use a field constraint?

I created a field Constraint named field1Constraint with field1ConstraintValidator based on UniqueFieldConstraint. It works. Then I created a field2Constraint which should use ...
1 vote
1 answer
940 views

How to get new password by mail instead of password reset url (Forgot password)

When we click on "Forgot your password" and enter email id, Drupal will send password reset URL by mail. But is it possible Drupal send any random password by email instead of URL? I have checked ...
0 votes
2 answers
697 views

Trying to create a table with an uid field that auto-increments and is the primary key, but keep getting an error

I'm working on an .install file for my module in Drupal 7. I want to create two tables, one called tls_connect_floormap_images and one called tls_connect_floormap_coords. I'm not having any trouble ...
0 votes
1 answer
660 views

Insert a collapsible fieldset or region in a panels layout

I created a custom layout for a panels display and I would like to have a region or multiple regions in my custom layout be collapsible with javascript/jquery. Ideally the state of the collapible ...
6 votes
3 answers
1k views

How to get a term from the translated term name?

I have a taxonomy term which, translated in Spanish, became Autos Y Motores. Since taxonomy_get_term_by_name() seems to expect an English string, I guess I first need to get the English string from '...
0 votes
1 answer
604 views

How to get the actual value of a field in Views?

I'm using the Views module and Drupal 7 and want to add a class to all rows of my table that have a certain value for a certain field. The field is a bit field and is included in my query. I have ...
1 vote
2 answers
740 views

Showing both original base price and calculated price (inc. taxes), when using two price fields and rules

Building a webshop for customer with Drupal 7 + commerce. I've defined two price fields for commerce product entity: 1) base price (excluding tax) that is wholesale price 2) retailer price (excluding ...
4 votes
2 answers
647 views

How to set Permission based on roles for Views Data Export

Using views data export module, I set the permission for different roles in the Data Export in Views like: But I can still see the Export button for all users in front page. However if the role doesn'...
0 votes
1 answer
926 views

working with LDAP authorization hook

While I have been able to use the LDAP authentication hook (hook_ldap_authentication_allowuser_results_alter) to perform additional authentication, I have not been able to use what I thought was the ...
1 vote
2 answers
504 views

HTML Form that Passes Information to Hidden Fields Through URL

I am trying to build an html form that is stretched across several pages. My intention is to use the GET method to send all of the fields data in the query string (URL parameters) and then store this ...
3 votes
1 answer
2k views

How do I send user credentials and get the access token?

I am linking a Drupal site to an Android application. With the help of the Simple OAuth module, users will log in to my android app using their Drupal site credentials. I understand that once the ...
0 votes
1 answer
1k views

AJAX form submit error when sending form to twig in hook_preprocess_page

I have a simple AJAX form that I can't submit when the form is passed from module to the template in hook_preprocess_page. The same form works fine if sent from controller, it's just that the layout ...
3 votes
2 answers
496 views

How to get 'base theme' information about a theme?

In an admin settings form in a custom module, I need to determine what base themes a specific theme uses (the default theme, not the current theme). If I know the child theme's name, how do I obtain ...
1 vote
2 answers
2k views

Add CSS class to <form> element using webform and template file

I have an existing webform in Drupal 7 which I am trying to theme. So far I managed to add CSS classes, placeholders, prefix, suffix,.. to form elements (fields) but not to the actual <form>-tag?...
0 votes
1 answer
3k views

Set value in a choices.js dropdown after it's been created

Using Drupal 9.4 and choices.js 10.2 (design required a highly styled dropdown that I couldn't do with a standard element). The choices dropdown is created by a view. When I had the plain select item ...
0 votes
1 answer
724 views

Ubercart Ajax change attributes on checkout

I want to change the Product Attributes on checkout page by ajax. But when I save it by uc_order_product_save() in my ajax request and go to the preview step the attributes are gone. It seems that ...
2 votes
1 answer
1k views

How do I use API versioning?

I'm using the Services module to produce a REST API. According to the official documentation, there is a way to version services resources. I believe version here means supplying a single API (e.g. ...
2 votes
2 answers
2k views

How to clear page cache without rebuilding other caches

I have a large site which uses Drupal cores 'page caching for anonymous users'. I have made some javascript changes which I need to deploy. Since pages are currently cached I will need to clear the ...
3 votes
2 answers
684 views

How do I access $this in a dataProvider method?

Is it possible to access $this in a PHPUnit BrowserTestBase data provider method to get access to properties defined in the testBase class? It seems that the sequence of processing during startup of ...
0 votes
1 answer
1k views

REST Basic Authentication not working

I configured my rest with services and installed the Basic authentication module. I used Postman and selected basic authentication gave username and password, I got "Missing required argument ...
0 votes
1 answer
831 views

Migrate: Create term(s) if they do not yet exist

Question similar to this question here, but this time, I am not doing a separate migration later. I want to create taxonomy terms if they do not exist while processing a record. Does entity_lookup do ...
0 votes
1 answer
21 views

Configurable products with reference to simple products

I'm in the process of creating an e-commerce site for myself. I'm a Magento developer but decided to learn Drupal. I'm struggling with a setup for configurable products. I'm able to create them in a ...
2 votes
1 answer
826 views

How to display physical dimension fields on node--product.tpl.php?

I am using the Drupal Commerce module and I want to print the physical dimension fields(machine name: field_width) value on product detail page. How can I print physical dimension fields value in ...
1 vote
1 answer
846 views

How to display product attribute as filter in product listing page?

I am creating an e-commerce website using ubercart and Drupal 7. I have created product attribute size and color for the product from the "Administration » Store » Products" and assigned to product. ...
2 votes
4 answers
4k views

How do I export an entity?

In Drupal 7, with the aid of features, we could do something like node_export, or uuid_features, etc. I'm looking for a good way to create content / other entities using the UI and export it to code ...

15 30 50 per page
1
2 3 4 5
1757