Questions tagged [8]

Version tags should be used for questions that apply to a version only, not to merely say what version a site is using.

Filter by
Sorted by
Tagged with
0
votes
0answers
19 views

File for template suggestion not picked up

I am using suggestions for a node , I have in the html source the suggestions: node--1.html.twig, node--1--article-list.html.twig, node--article-list.html.twig, and node.html.twig Whenever I use ...
0
votes
0answers
12 views

Shipping profile address type select to radios

I am trying to alter the shipping information pane. It uses a select list for the profile address I want to make it a radios type instead and when I use the form_alter to hook into the checkout pane, ...
0
votes
1answer
75 views

How can I disable all the JavaScript scripts?

I am trying to disable all the JavaScript on all the pages of a Drupal 8 site for anonymous users if there is a particular header in the request object. I tried out this code. /** * Implements ...
3
votes
1answer
26 views

How can I capture Watchdog output during a functional test?

I have a functional test that is failing, and I think that there could be some useful information in the database log, but unfortunately the test suite only runs in containers on GitLab CI so I don't ...
0
votes
2answers
49 views

Language switcher block is different on remote site

I'm working on a multilingual site and on my local version of the site I added the default language switcher. It show like this: <div class="language-switcher-language-url block block-language ...
-1
votes
1answer
24 views

Breadcrumbs not appearing

I have a custom theme extending the bootstrap theme. In my theme there are no extra files except the .info.yml file. Everything else is inherited from bootstrap. I have also kept the regions in my ...
1
vote
1answer
69 views

How do I customize an entity's canonical page? [closed]

I have an entity called SyncJob and it contains the following fields: id progress: integer total: integer I need to customize its view page (canonical, not the collections one) to show the following ...
0
votes
0answers
19 views

What is the status code for “Draft” in content moderation?

I implemented Content moderation workflow for my headless D8 project and created workflows and enabled for all content types. Salesforce is the fronend application which uses graphql to get the ...
0
votes
0answers
19 views

How to rewrite a Views RSS?

The RSS Views Feeds are very restricted. I created an RSS Views Feed to display the Message (https://www.drupal.org/project/message). I want to rewrite the RSS Views Feed and I want to display the RSS ...
0
votes
0answers
46 views

How can I invoke a custom submission handler for a view field?

I would like to display a button for each content displayed in a view. In a custom module, I have added a custom submission handler to the edit form (hook_form_FORM_ID_alter()) and defined the action ...
0
votes
1answer
17 views

Link to a referenced entity

I have a entity A with an entity reference to entity B, and an image field. I created a view to display an entity A. I want to link the image field to the page displaying the referenced entities B. ...
1
vote
1answer
52 views

How to set field value in custom webform submit handler?

In a custom submit handler, I want to set a field value for a text field (my_field_machinename) in my webform. The handler is getting called correctly, but the value is not getting stored. What do I ...
2
votes
0answers
30 views

What is the equivalent of hook_image_styles_alter()?

I would like to allow uploading of SVG images to all the existing image fields with image effect. However, I wouldn't like the image styles to be applied to SVG images, as it is mostly designed for ...
1
vote
0answers
39 views

What's the easiest way to dynamically set <front> on a per request basis?

I need to be able to set the front page based on the current language (derived from domain) and brand (also derived from domain). I initially tried to set this up with views, but I need the front page ...
1
vote
1answer
28 views

How do I show a product attribute in a cart?

I don't know why the item name shows "price" in the shopping cart. My product variation type have 2 fields: Certificate choice (attribute) and Course period. How can I customize my ...
2
votes
1answer
43 views

Can I insert the version number in the info file of a module for internal use?

The documentation on the creation of custom modules says, # Note: do not add the 'version' or 'project' properties yourself. # They will be added automatically by the packager on drupal.org. so I ...
0
votes
1answer
31 views

Show latest changes in node “View” tab while using Content Moderation

I had been trying a lot to display latest revision into view tab irrespective of its state, so if a node is in "Draft" state I still want it to be displayed under "View" Tab rather ...
0
votes
1answer
27 views

Using Entity Print to generate several PDFs of a Webform submission

This may be too vague a question as I'm just starting to work through this. Would very much appreciate any pointers/experiences if people have done something similar. Functionality I'm hoping for: ...
0
votes
1answer
37 views

How do I use a term as contextual filter correctly?

I'm using Drupal 8. I have a book content type that uses a vocabulary called "book type" as an entity reference field. I have basic page content type which also uses the the vocabulary "...
0
votes
1answer
26 views

How to display the first child of a book with the title of the book and keep the url by using a view

Is it possible to display the list of the first child of every book with a view? I couldn't figure that out so I added boolean to the book content type to check which child is the first child. If that'...
-3
votes
1answer
16 views

Attached all images from taxonomy in view

I am creating a view of a content type and content type is linked with you to taxonomy with has images. Now, i have added Relaionship as well. But now if my node is attached to muliple taxmony term it ...
1
vote
1answer
71 views

How do I compare a date field with the current time in a twig template?

I have a date field on a node – set to a custom date format (c which is ISO) in the Manage Display. I have a twig template checking to see if that date field comes before today, in which is should ...
0
votes
0answers
13 views

Batch process is getting duplicated when the batch URL is reloaded or duplicated in new tab

I am using Batch API to perform certain code manipulation task. The batch works completely fine except for when the batch URL is reloaded or duplicated on a new browser tab. This leads to the batch ...
0
votes
0answers
29 views

How to describe dynamic config.settings values in schema.yml

I have a module config settings.yml file with a dynamic list of the fields attached to a user entity, eg archive: directory: user-history/archive/ filename: user-history-archive max_cardinality: ...
1
vote
0answers
26 views

Search Api display search term in form

How do I display the search term after I have run the search. Here is my form: <input data-drupal-selector="edit-search-api-fulltext" id="edit-search-api-fulltext" placeholder=&...
1
vote
0answers
26 views

How to render Messages in an AjaxResponse? [duplicate]

I have a modal form which when submitted calls submitModalFormAjax(). I am trying to get the messages that were previously created and use an AjaxResponse command to print the messages to the modal's ...
0
votes
0answers
40 views

How we can remove field--type-entity-reference-revisions div from a paragraph

I am using paragraph module. and create a twig tempate for the paragraph - paragraph--machine-name--default.html.twig but It generated a div at starting of paragraph having class field field--name-...
0
votes
1answer
42 views

How do I use the mail manager without the $to value?

I want to send an email for multiple users without a to address. Setting $to NULL, and empty string 'undisclosed-recipients:;' doesn't work. How can I send an email with just BCC recipients?
0
votes
0answers
22 views

Exclude specific weekdays from date field

I am using a date field in the Commerce Order to pick up the product (Collection Date) Currently, there is a restriction to select dates in the past. Is there an option on the date field, somehow to ...
2
votes
0answers
99 views

Multiple dependent form fields

I'm building a form following the ajax examples module, specifically the dependent dropdown form. I've tried the same approach as the example, calling a static function to retrieve the options for the ...
0
votes
1answer
52 views

How can I print the translated entity title in a template?

I have a reference field for nodes and I have a field template to render the the fields. {{ item.entity.title.value }} But I can't get the translated title of the node. Can someone help?
0
votes
0answers
45 views

How do I alter a bundle and programmatically add a form with a custom form mode?

I have created a custom entity type called custom_enitity and new bundle scores, using UI. Also got custom form display called score to add score via custom route. I keep getting the following error ...
0
votes
0answers
38 views

Multiple databases

I'm having trouble getting Drupal to switch between multiple databases. I have a system that involves connecting to an external database to retrieve data. I am using the following code inside of a ...
1
vote
1answer
41 views

How to create a view of Media images that do not have any Alt Text

For accessibility purposes I want to create a view of Media images that do not have any Alt Text. Creating a view of Media images and also displaying Alt Text is not difficult, as explained is this d....
1
vote
1answer
36 views

How to set the href with the pathname of the current page in it?

Inside a view I have a block for which there is a field called Global Perspective. Inside the block override , I have rewrite rules which overrides teh out of the field with custom text. <div class=...
0
votes
0answers
35 views

How do I build custom options for sections?

I manage to build/define some custom blocks with my own parameters/form elements when placing them, so I'm looking to do the same with sections. I've seen that the core code does that, but ideally I ...
2
votes
0answers
21 views

Entity Validation API not invoked on saving the taxonomy overview form – misunderstanding or a bug?

I have a Constraint and ContraintValidator to validate a field of taxonomy terms. Its a hierarchical taxonomy called channel with a field field_product. It's required that a channel has the same ...
3
votes
1answer
51 views

How to get a view result programmatically without exposed filters respected

I have some views of display page which I do not want to show to public if there would not be any result when accessed without any exposed filters set. I have a custom views access plugin and a custom ...
0
votes
1answer
23 views

Commerce custom taxtype wrong calculation

I want to add spanish recharge tax to drupal commerce. It is calculated like VAT but only for some customer in a B2B bussines, and It is a second tax, that is, you have to calculate VAT and "...
4
votes
1answer
57 views

How to add an autocomplete field with pure javascript

I'm implementing the javascript library Annotorious which allow to add annotations on an image. My goal is to be able to link content with part of the image select with Annotorious. When we select a ...
0
votes
0answers
28 views

Clean pagination URLs

I'm currently upgrading my site from Drupal 7 to 8 and I'm having trouble with the pagination URLs. On the Drupal 7 site we use the Clean Pagination module which changes views pagination to be /news/...
0
votes
0answers
18 views

Views agenda page not updating (still cached)

I have a Views page to create an agenda of events. The views has a filter to show only agenda items that are in the future. I created a similar setup for multiple site but on this one the agenda is ...
0
votes
0answers
15 views

Configure Facets to drill down one level at a time

I have vocabulary ("Subtype") hierarchy like this... CP LP ML U BL FL AD MA PD OPD SG I have a field on my entity type field_subtype. What I'd like is to configure my search api ...
0
votes
0answers
66 views

Antibot Failing when Webform Embeded in Gutenberg

When enabling Antibot on a Webform rendered through Guntenberg, I can not submit the form. Create a "Custom Webform" block type with a single entity reference field for Webforms. Create a ...
0
votes
0answers
13 views

Filter view by entity sub-queue?

Is it possible to filter a view by a sub-queue within an entity queue? My current setup is: Entity queue with multiple sub-queues created (I've only created 2 sub-queues at this point.) Setup a view ...
0
votes
0answers
43 views

How to disable an alias path (for an unpublished page)?

As path aliases now seem revisionable (from 8.8.x, see Convert path aliases to full featured entities) what is the best way to set an unpublished page (that was unpublished by a content moderation—as ...
0
votes
0answers
11 views

Does the login-link users receive upon registration actually expire?

I'm trying to expand the duration for the expiration of the one-time-login for the initial registration process: user clicks on "create new account" after filling name and email and sending ...
0
votes
1answer
122 views

How to get parent paragraph from a child block preprocess

Searched all over the place but cannot find anything similar. Here's the issue... The setup: 'Page' content type 'Block Content' paragraph type The 'Page' content type has a field for referencing ...
0
votes
0answers
20 views

Can't get distinct rows from taxonomy view

Drupal 8 has a problem with creating distinct views, and the distinct views module hasn't been ported yet. I've been researching this today, and haven't found a good solution. I wrote a custom hook in ...
0
votes
1answer
9 views

Get all available promotions for specific commerce product

How to get all available promotions, which apply to specific product?