All Questions

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

How to get the entity ID in a twig template

I have a custom entity, with the template my-custom-entity--my-entity.html.twig. How do I access the ID in the template? I can do this by implementing hook_preprocess_entity, but am wondering if the ...
0
votes
0answers
2 views

How can I delete in bulk the submissions on a workflow

I have 400 some odd responses to a woprkflow i would like to delete. I dont want to delete them individually. How can i do it in bulk? Tha
1
vote
1answer
23 views
+50

How to send system mails in html format (with Swift Mailer)?

At Account settings page (/admin/config/people/accounts) I can edit system mails Drupal is sending (Welcome, Account activated, Account blocked and so on). I also installed and configured Swift Mailer ...
0
votes
2answers
690 views

Always show next page link in pager

function mythemename_pager_next($text, $limit, $element = 0, $interval = 1, $parameters = array()) { global $pager_page_array, $pager_total; $output = ''; // If we are anywhere but the last ...
0
votes
0answers
3 views

How to fire Drupal Rule when more than single term (from multi value vocab) is selected

In this Drupal tutorial - https://www.drupal.org/node/2815377 - the author demonstrates how you can get a rule to fire if you have a field with a vocabulary with terms termA, termB, termC, and termD ...
0
votes
0answers
2 views

Is it possible to rewrite sort field in views (Drupal 7) without using additional modules?

I need to sort by title but some of titles start with a space and sort is putting titles with a space first (before a,b,c, etc). So I would like to use trim when I sort by title. The view is part of ...
2
votes
1answer
404 views

How to display entity label using entity reference field checkbox form display

I am working with Drupal 8. And I want to create a field of entity_reference type. The field has a reference to context_question entity. And the field is displayed fine, but without any description ...
3
votes
1answer
347 views

Is there a way to add node grants to anonymous users?

I want anonymous users to be able to access nodes that are promoted to the frontpage (they can't access to nodes that are not promoted) and hook_node_access does not seems to be called for anonymous ...
0
votes
1answer
19 views

Is there a way to bring content files into views with white space removed? Drupal 7!

I am certain I am missing something obvious here. I am trying to have the title in a view 2x, once as the first initial (A) and once as the full title (Alabama) and then have drupal group these fields....
1
vote
2answers
1k views

Is there a way to import Paragraphs with Feeds module (no code)?

Given a Content Type (a Node), which has a Paragraph field, which in turn has some fields on it, is there a way to import the Paragraph fields into the Content Type using Feeds (or some other method, ...
2
votes
2answers
770 views

Making custom database text fields available for search

I have a custom module that stores text records in a table, however this table records are not mapped to nor an entity neither a node, so as far as I know, I can't expose them to the search module or ...
0
votes
0answers
12 views

Drupal 8 administration menu links are incorrect

I installed drupal 8 using composer, which installed at location /var/www/html/drupal8/web. I updated apache root directory to this location, which allows me to access the site at mysite.com (rather ...
2
votes
2answers
4k views

How can I run client side validation before a Drupal AJAX submit call?

I'm trying to perform client side validation using jquery.validate.js on a form submitted via Ajax (using form actions), but for some reason, the client side validation is not being triggered. This ...
0
votes
1answer
13 views

how to print a form in twig where a variable number of form elements have been printed already?

I am using a Twig template to render a form that has a variable number of elements. Each element's key in the form is sequential integer. So in my template, I can do this: {% for item in form|children ...
0
votes
2answers
352 views

Children of children not appearing in book navigation menu

UPDATE: I should mention that this is concerning the Book Navigation Block I'm using the book module to display children of a book in a side menu. It displays the title of the book and it's children ...
0
votes
0answers
16 views

Missing required keys (core) in modules/contrib/ctools/ctools.info.yml

after doing a migration from drupa 8.7 to drupal 8.9 , after done drush updb i am facing this problem which is " Missing required keys (core) in modules/contrib/ctools/ctools.info.yml" so ...
0
votes
1answer
346 views

Return Table and Form in page callback

I have a problem returning table and form in page callback at the same time it only works if one of them only returned. function _table_maps(){ $query = db_select('maps','m'); $result = $query->...
0
votes
0answers
23 views

For performance, one multi-value field or four individual fields?

I have a node content type that needs to store four different int values: Score A Score B Score C Score D Each node of the content type always has all four int values. I could store this one of two ...
1
vote
1answer
532 views

Advanced Migration - update nodes

I'm a little bit new in Drupal but experienced in PHP. I would like to migrate data from CSV and assign to existing nodes in DB. My question is about the possibility to match processing rows with ...
0
votes
1answer
349 views

How can I use tokens for Addressfield values without using Addressfield_tokens?

I would like to use the Town/ City field as a token for Pathauto. I thought the Addressfield_tokens module was perfect for this, but Entity Tokens breaks Pathauto's patterns control panel; the issue ...
-2
votes
0answers
43 views

How much do I need to pay to use Drupal? [closed]

Is Drupal free? How much do I need to pay to use Drupal?
-6
votes
0answers
59 views

What exactly is Drupal? [closed]

I'm not sure what Drupal is or what it's for. I am wondering of someone could enlighten me, like how Ubuntu is an operating system, what is Drupal?
-2
votes
0answers
25 views

Clear render cache with Rules

In Drupal 8, i want, every time I publish a node, to clear render cache. I am trying to do it with Rules, but I didn't find the action to do it.
0
votes
1answer
906 views

Taxonomy terms with conditional field

50 terms and each term needs to have radiobuttons or "other". Food - o in price - o extra price Drinks - o in price - o extra price WiFi - o in price - o extra price So "in price" and "extra price"...
3
votes
1answer
38 views

Load nodes by property, including empty ones

I want to render a node with certain properties set. For example, I want to load every node which ONLY has field_a and the other fields are empty. If I use $this->nodeStorage->loadByProperties(['...
7
votes
2answers
5k views

How do you add a PDF attachment to an email?

Goal: I need to send an email with a pdf attachment in Drupal 8. Progress I am able to send an email with subject and message but have never been able to get the attachment. When I turn on the logic ...
-1
votes
1answer
95 views

Possible to change the url path?

Wonder how to make http://example.com instead of http://example.com/drupal? I want everything intact without changes. Searched for an answer on Google, but there seems to not be one.
2
votes
0answers
17 views

How can I correctly attach a file to a mail?

I am very new to drupal and need to upload a file and sent it as attachment in Drupal 8. I have created the form element like $form['candidate_attachment'] = [ '#type' => 'managed_file', '#...
3
votes
2answers
397 views

Custom Path Alias with Initial Letter as Token

For various reasons, I need to change my custom path alias for a taxonomy type as follows... FROM: /composers/aardvark TO: composers/a/aardvark So I'm looking at either creating a custom token, or ...
0
votes
1answer
10 views

Upload multiple Standolane Media Entities (Images) without Reference Field

I'd like to Upload Images as Media Entities without referencing them in another Entity. In media/add/image I can upload a single Image. That's fine. What I'd like to achieve is a Multiple Upload ...
0
votes
1answer
472 views

How to use 'use-ajax' class with pages created by controller?

I'm trying to use 'use-ajax' class to load a page inside a modal box. My Page is dynamically created using node id pass on my page controller My link looks like this Any idea on how can I achieve ...
7
votes
1answer
2k views

How can I add a CSS class to the body tag based on the current path alias?

Is it possible in Drupal 8, to add a CSS class to the <body> tag based on the current path alias?
3
votes
0answers
911 views

Why are the thumbnail images not loading?

I am using Drupal 8, and have just moved my site to shared hosting. When I upload a standard image field on my shared hosting environment, the thumbnail image does not show up. This works perfectly on ...
0
votes
1answer
462 views

User must click Back button twice after adding item in cart

I have added Drupal Commerce in an existing D7 site and I use the existing product nodes, in which I have added the Add to cart form. Everything looks nice and works fine, except for one thing. When a ...
0
votes
1answer
348 views

Change the default image based on certain condition

I wonder if I could provide two default images -one for boys & other for girls. In the registration form they can choose their sex from a Boolean field. Is it possible with conditional fields ? ...
0
votes
0answers
22 views

The SQL storage cannot change the schema for an existing field (id in sms_phone_number_verification entity) with data

I am using the SMS Framework module and after updating my site from Drupal core 8.8.8 to Drupal Core 8.9.3 and the SMS Framework module from 8.x-1.3 to 8.x-2.0.0-alpha1, I start seeing the below error ...
-1
votes
0answers
28 views

Getting values from checkbox in foreach loop form

Im building a custom module, this module is getting data from values in db, i have created the form using this way: $data = []; foreach ($nodes as $node) { $getData = \Drupal\node\Entity\...
1
vote
0answers
17 views

Use Order Number in Receipt

I want to use the Order number rather than the order id. I'm using Commerce POS and it uses $commerce_order->id()to generate the id used in the receipt generated and receipt email sent. But in ...
0
votes
1answer
432 views

Quick Edit setup and usage

I added quick edit to my site. Made sure all the correct libraries are in place and see the quick edit button in the gear next to the content, but am not getting any way to save the changes. The ...
-1
votes
1answer
66 views

Form in custom module using Controller: The HTML tag form isn't present in Twig

I'm trying to render limited user edit form on custom page using Drupal Controller. In the routing.yml I defined _controller, I do not want to use _form. I want to display on the form e.g. only ...
1
vote
2answers
377 views

Drush dl not working on Ubuntu with postgresql backend

modules can be added manually, but drush dl or drush en produce errors and will not download a module database section from settings.php $databases['default']['default'] = array( 'driver' => '...
1
vote
3answers
2k views

How do i change date format in View Exposed Date filter?

How do I change date format in View Exposed Date filter? By default it's in d/m/Y format, I want to make it Y.m.d format, without changing the query parameter date format (Y-m-d). Any suggestion, how ...
2
votes
1answer
409 views

Add the same field multiple times to a display suite node display

So I'm using display suite with a 2-column layout, and my node has an entity reference field (field_journal). I'm already displaying field_journal as a rendered entity in the LH column, but I'd also ...
0
votes
1answer
347 views

Where to add track_changes option in migrate_d2d class

I have an ongoing migrate_d2d migration where I will need to be able to detect changes on a node by node basis, and I would really like to be able to use the functionality in the Hash source rows to ...
1
vote
2answers
459 views

Entity Reference and Views to allow a nested structure

I'm trying to implement a nested structure in such a way as to get a table (within a view?) similar to this: Parent Child Grandchild Age Sex John ...
0
votes
2answers
921 views

How to render inside a paragraph template a specific view mode for that paragragh

You may say that I should just change the display settings but in my use case I need to include 2 view modes inside one template as the mobile and desktop version of the output require very different ...
2
votes
1answer
498 views

Accessing content for a specific node revision via a relationship in Views

A module I've written implements hooks defined by the Field API to provide a custom field for defining references to specific node revisions by storing vids. (The module borrows functionality from the ...
0
votes
1answer
644 views

Populating select list from a taxonomy term field

I'm trying to populate a select list dynamically by pulling its values from a taxonomy term field linked to the current-user account. Just to clarify, below function is a hook defined by a module that ...
0
votes
1answer
14 views

Check if the user has flagged content with any flag

It is possible with the following code to check if a content has been flagged by the current user with a certain flag: $flag = flag_get_flag('flag_name'); if ($flag && $flag->is_flagged($...
1
vote
1answer
401 views

How To Upload Image From Media Library Programmatically?

I enabled latest version of media module to upload images in wysiwyg. It is working fine. There is no problem. I want to upload images programmatically from media library. Below is my code. ...

15 30 50 per page
1
2 3 4 5
1662