All Questions

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

How do I add classes to blocks?

I am using Drupal 8 Panels and it is working fine. The problem currently I have is, that I want to add classes to individual blocks on the panel layout page. Is there a way to add classes to blocks on ...
0
votes
0answers
3 views

Possible to cache non drupal pages in page_ceche table?

I use drupal 6. For existing content type article (path /somearticle), I created a new template so if user asks for path /xyz/somearticle. Here, I am pulling some data from original article. Would it ...
0
votes
0answers
30 views

Prepopulating composite webform field from data passed by POST

I need to POST a JSON to a URL with a webform on it and have the WebformHandler. This is the alterForm of my WebformHandlerBase subclass public function alterForm(array &$form, ...
0
votes
0answers
5 views

Unresolved dependency updating the Views Module

I'm updating the Views module on my D7 site, and I'm receiving this message when I update the database: How do I resolve this dependency issue when I need to update the views module first? Thank you ...
3
votes
1answer
165 views
+100

View display plugin “entity reference” not using translation

For some of my entity reference fields I'm using "Views: Filter by an entity reference views" as reference method. I've configured those views to use the current interface language for rendering (with ...
4
votes
2answers
1k views

How do I filter by node ID in views?

I am trying to add Node ID in contextual filters but it seems there isn't Node ID anymore.
3
votes
1answer
393 views

Why does loadMultiple load 1000 nodes 9.2 times faster than loading each node one by one?

I have always known that loading multiple nodes at the same time is faster than loading nodes one by one. What I wasn't aware of, is the huge performance difference between the two ways of loading ...
0
votes
1answer
825 views

Webform: POST data and send user to external URL

I was reading this interesting post: Webform - Submit values from Drupal 7 from to external url I'd like to know: instead of just sending the data via POST and keeping the user on the Drupal site, ...
0
votes
0answers
10 views

Theme suggestion for commerce-cart-form input--submit buttons [duplicate]

I have a Drupal Commerce cart view (overview of the cart). In the form 3 buttons are rendered. delete-order-item button update list button checkout button I want to create 3 specific theme ...
1
vote
1answer
13 views

Patch method sample code REST API

I am working on web services in drupal. I have created a sample module for get method to expose the data using web services. I have not found any sample code for the patch method. code for get method: ...
0
votes
0answers
15 views

Composer update still shows an older version of a module

Updating dependencies according to these instructions offers an older version of the module. Composer.json file has the package required as "drupal/h5p": "^1.0@RC", and it used to update just fine. It ...
2
votes
1answer
374 views

How do I set a product image?

When creating a product node for Ubercart, how do I set the product image? I am using the following code to create a product node. $node = new stdClass(); $node->name = "Title"; $node->title ...
-2
votes
0answers
9 views

How to create a slide up menu on mouse click [on hold]

Does anybody knows a method or a Drupal module helps in achieving the Slide Up Menu shown in the above image for a online website: 1) The below image show that there is no visible menu to perform an ...
0
votes
0answers
18 views

How to show date as “XX ago” in comments/node/taxonomy/blocks? [duplicate]

This code works for comments but I need to display the date in two digits (XX minutes, XX hours, X year) not as "XX hours XX minutes" for example. And I need to apply this format for the rest of the ...
6
votes
3answers
5k views

How to create a multilingual node programmatically?

In the last days I tried to migrate a multilingual CSV file to Drupal 8 without success, so finally I decided to use a Batch Process to accomplish the task. At this moment I have the batch process ...
-1
votes
0answers
16 views

Site HTTPS insecure on some browsers and others are fine

I have the following url: https://www.example.com/about It shows that it's insecure on my phone, Edge, and Firefox browser. But on Chrome desktop it works correctly by redirecting it to the https://...
0
votes
1answer
859 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
0answers
50 views

Using Layout Builder with Menus

I followed this tutorial but am having some issues. I enabled menu_link_extras and layout_builder on my site. I enabled layout builder on my menu, added a menu link and added a block to that link's ...
0
votes
0answers
52 views

Ajax Issues with Drupal Layout Builder

We're trying to use the new Layout Builder to configure some of our content types. When we click the "add section" button under Manage Layout, we get the following errors: On the page in the console ...
0
votes
0answers
24 views

Using Layout Builder With Menu Items

I recently just updated to 8.7 and for the most part everything is working well. In my dev environment I was working on a new feature using layout builder with menu_item_extras to apply a layout to ...
0
votes
1answer
27 views

Ajax add command to open a new URL

in a custom module, I created a custom form. On this form, I have an ajax button to open a specific file (.pdf). Here is my code in a custom submit function : $url = 'myfileUrl'; $response = new ...
3
votes
0answers
46 views

How to achieve layout nesting in layout builder?

We have a content type (Page) and a vocabulary (Sections). The content type has a reference field to the vocabulary, and the vocabulary has a reference to a menu. Also, we are interested in being able ...
3
votes
0answers
42 views

What is the underlying logic for generating an icon map for a custom registered layout (in Layout Builder)?

There seems to be a dearth of information on the internet about how to generate an icon_map for newly registered layouts in Layout Builder. I've gotten as far as finding a patch file from the project ...
0
votes
2answers
92 views

Layout builder “edit layout” form missing revision log message field

When I edit the layout for a given node it is missing a log message field in the revision area. Is anybody else seeing this or am I alone? In trying to diagnose: Where that particular revision log ...
3
votes
2answers
193 views

Delete a block of all layouts

I am using Layout Builder (Drupal 8.7.1) I have a block in several Layouts. How can I programmatically remove all instances of this block and update all layouts without the message "This block is ...
-2
votes
0answers
31 views

Calendar/datepicker popup not working on safari

Below is the date type form field I have in some form which renders on chrome correctly. $form['date']['air_date'] = array ( '#type' => 'date', '#title' => t('Air Date:'), '#required' =&...
-2
votes
0answers
14 views

Paypal error on checkout [on hold]

Client error: `PATCH https://api.paypal.com/v2/checkout/orders/` resulted in the following response. Could not retrieve the order from PayPal with the following remote_id: . So I don't have a ...
4
votes
1answer
1k views

Ajax pager with form callback

I created a form using the form api that outputs a list of results via an ajax callback. I want the said view to paginated. How can i do that? I'm using drupal 8 and don't want to use embeded views.
0
votes
0answers
13 views

Assign a particular permission to a specific user role while installing the module [duplicate]

I have custom permission called Access vm content list in my module's module_name.routing.yml. And I listed the same in the module_name.permission.yml to get it managed via admin panel. While ...
0
votes
1answer
25 views

UTF-8 encoding when creating nodes (from mails)

I'm making a customized version of the Mailhandler module (based on inMail), which has a node creation function: protected function createNode(MimeMessageInterface $message, DefaultAnalyzerResult $...
1
vote
0answers
23 views

Webform module loosing language for referenced options

First I have content type "Quiz option" which is translatable. Then I have a view that returns Entity references of that type. For language option I selected "Content language of view row" and also ...
-3
votes
0answers
24 views

How does accessibility compliance in Backdrop CMS compare? [on hold]

One of the benefits of Drupal 8 was to enhance compliance with Section 508 accessibility requirements. To what extent does Backdrop match Drupal 8 regarding those improvements? Do those ...
3
votes
2answers
329 views

Upgrading from Pressflow

The ultimate goal here is to take a somewhat large (about 15,000 nodes) and complex (many contrib and custom modules) site from Pressflow 6 to Drupal 7, so I am assuming I should make the shift to ...
1
vote
1answer
782 views

URL rewrite of localisation with nginx

I'm having trouble with changing the url of a drupal localisation. All urls are clean, but contain a non-clean localisation part; ?q="language", e.g. ?q=de, ?q=fr. The site runs on nginx + mysql + ...
3
votes
0answers
67 views

How do we programmatically place a section and then a block in that region on module install?

We are looking for the best way to export a defined/built layout with inline blocks and then use that to programmatically set both them during a module install. eg. module install create node in ...
0
votes
2answers
4k views

get file path of image style as replacement patterns in views

i need something like <img attribute1='value' src='sites/default/files/styles/thumbnails/**pic_0**.jpg'> in views. i have to use rewrite result because i need attribute1. but i have no idea ...
3
votes
3answers
618 views

Switch theme by content type

My company has just purchased a Drupal theme to apply to some new pages they want to add to an existing site. This theme is different to the existing theme of the site. They want to create a new ...
0
votes
2answers
2k views

creating child terms from a parent using fields

For a project i would like to achieve the following: Using 2 fields in a content type field_parent = reference to term This field references to vocabulary 'parent terms' I have a second field ...
0
votes
2answers
828 views

add_where() causes the view not to be displayed

have a page that features a few views based on content types. Each content type includes a keyword field. This page is reached from a short quiz. I'm trying to limit the content in the views based on ...
2
votes
3answers
831 views

How to use curly braces in schema default value?

I have a long varchar field that I'm using to save serialised data with drupal_write_record. I'd like to set the default value of the column to "a:0:{}" (which is serialize(array())). However, when ...
0
votes
0answers
16 views

Block or ban ip addresses based on site-wide contact form category

How to create a rule with the Rules module that blocks or bans ip addresses based on the category that they selected on the contact form for anonymous contact submissions via the site-wide contact ...
-4
votes
0answers
32 views

Show different item each render [on hold]

I have a Drupal 8 view that has several items in it, but I've configured it to show just one. What I want to do now is to iterate through the items on each page render, so each item get's equal ...
0
votes
1answer
373 views

Install Meta Tags and Meta Tags Quick modules on the same site

Short: Are Meta Tag and Meta Tag Quick incompatible modules? I am configuring a site that has Meta Tag Quick module but it doesn't allow me to have a meta description tag. It creates an Open Graph ...
1
vote
2answers
4k views

Node Export and VBO

In an effort to mass export all my nodes, I installed Node Export and VBO. The NE project page claims that it supports VBO, but I can't seem to edit the prepackaged VBO view and add the Node Export ...
2
votes
3answers
1k views

how to make a form field be required with hook form alter

I want to alter a form to make the revision log be required. with drupal 8, I am adding this in a module $form['revision_information']['#required'] = TRUE; but the field does not become required. ...
1
vote
1answer
752 views

How to prevent entering a time-slot that is already taken when using the Calendar module?

I have installed and enabled the Calendar module. I have noticed that this allows multiple events for the same time slots. It means if event 1 is on Aug 12th from 11-12, I can still enter the same ...
2
votes
2answers
1k views

Pseudo-fields and custom entity properties from additional schema

I'm trying to add property information to an entity which uses the entity API. Working from the commerce_product module I am trying to manage additional information outside of fields and in my own ...
1
vote
2answers
1k views

how to render a node field of a referenced node on the node form

I'm using Display Suite to show a referenced node inside another node in the default display. But when I edit this node that has the entity reference field on it, it shows me the reference field and I'...
1
vote
1answer
27 views

Why ajax button calls submitForm?

I have no problems with using Ajax in every form element other then button. When I'm clicking this button '#type' => 'submit', '#ajax' => [ 'callback' => '::ajax_function', '...
3
votes
1answer
694 views

Why does my site fail after restoring the database?

I tried migrating my Drupal live site to localhost to test it there. I followed the instructions in Migrating a site. Cleared the cache Disabled clean URLs Enabled mod_rewrite Then I backuped my ...

15 30 50 per page