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
-3
votes
0answers
24 views

Google field not visible [closed]

I'm using the Metatag module . In the advanced section, I don't see the Google textfield whereas code exists in the system. Can someone suggest what is wrong?
0
votes
1answer
41 views

Linking two different views for the same content type

I have a content type with around 50 fields with three groups A,B and C(grouped in views). I have a view which shows the new content added in table format(limited fields). I do not want the table to ...
0
votes
0answers
2 views

Adding Order Items to a Complete order and process the payment for newly added Items

I want to add more items to a order that is complete using the default workflow. Is it possible to change the state of the order again to draft and accept payment for the newly added items in drupal 8 ...
1
vote
1answer
29 views

Limit size of cachetags table

One of the site has fairly large cachetags table at over 418K records. Is there a way to limit the size of this table. This table is not cleared on cache clear. Since Drupal 8.4 there has been a way ...
0
votes
0answers
12 views

Suggested template in layout builder is not being picked up

I am using Layout Builder and I would like to tweak template file a bit. I can see suggestions here: But although I added file layout-twocol-section--node-npx-training-teaser2.html.twig in my theme ...
0
votes
0answers
37 views

How do I convert URL parameters to lowercase?

We have a routing.yml file in Drupal 8 which contains the following lines. testmodule.res: path: '/subject/{node}' defaults: _controller: '\Drupal\testmodule\Controller\resController::res' ...
0
votes
2answers
28 views

How do I override an entity view controller?

I am trying to override the entity view controller for a commerce product view, so that I can redirect the user based on certain conditions. I am trying to do this through the RouteSubscriber::...
0
votes
1answer
15 views

When using a grouping field in an HTML list, is there a way to determine the group/loop number of the current content being rendered?

I want to be able to determine what group number is currently being processed to that I can treat the output of the first group differently than subsequent groups. Unlike rows, I do not see a way to ...
1
vote
0answers
28 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 ...
-3
votes
0answers
32 views

Custom call throbber effect

Is there a way we can use throbber progress in custom call drupal 8. I am also using ajax loaded as well. $("#button").on('click', function(){ jQuery.ajax({ url: base_url + "/...
2
votes
3answers
23 views

How can I use one of the pre-set email texts for user registration in a custom module

At /admin/config/people/accounts, there are several stock email messages set. How can I use one of these when I am sending emails from a custom module? The text that's being used in "Welcome (new ...
1
vote
1answer
37 views

How to add “rel” attributes to all external links throughout the website?

I'm trying to add attributes for external links such as the rel="noopener noreferrer" for all the external links where target="_blank". I've tried using modules such as the ...
0
votes
0answers
16 views

After installing and configuring simplesamlphp_auth module gives Error on clearing cache

I installed simplesamlphp_auth(8x-3.2) module with drupal (9.1.x). SimpleSAMLphp (1.18.8) is configured correctly. saml authentication works fine, but while clearing cache i am getting the below error....
2
votes
1answer
78 views

Best practice: Twig logic versus Preprocess functions

I use Twig and Twig Tweak to do most of the processing. However, from time to time I need to rely on Preprocess functions to get the desired result. This led me to a situation where now most of my ...
0
votes
1answer
22 views

Create ECK Entity via Ajax

I'm trying to create a ECK Entity Content programmatically. I know, because I've used it elsewhere, I have the right code for creating the Entity Content but in my current setup it is not working ...
1
vote
0answers
62 views

How can I have node pages with Fivestar or comment fields cached properly?

I was struggling with high page load time for my node pages when I realized that the problem was due to content pages not being cached (html render cache). The page is rebuilt after every single ...
0
votes
0answers
15 views

Webform uploaded files attached two times to email

I set up a webform with a file upload to the private file system. One field, one file. I configured the smtp auth module and a mail body with custom values. I unchecked all values but the managed_file ...
0
votes
0answers
10 views

How to set absolute URL for images uploaded in CKEditor instead of relative URLs

I am using CKEditor to send HTML user emails. When I upload an image by using the image icon from the bar, the image src is a relative URL to the image. This is causing issues in the emails. If I use ...
0
votes
0answers
11 views

Replace 'all' for 'All' at any exposed filter criteria

I'm trying to replace the 'all' value for 'All', because I'm getting an error if I use it as 'all'. Is there any way to accomplish this? Before: price_selector=5&price[]=5&play_styles=All&...
0
votes
1answer
18 views

Field weight in display mode is not respected on custom entity

I have a custom entity type with a set of base fields and I can create/view/update/delete entities. However When I create & enabled a custom view mode to the entity type and set to display subset ...
0
votes
0answers
13 views

Adding html tags to the Views module title area

One of the common things I do with Drupal 7 Views module is that I use the small tag (<small>) to provide a brief description for the view block/page. For example; Quick Search<small>...
-1
votes
0answers
26 views

Programatically render field widget inside dialog

I created a custom email field with a widget that has about 4 form elements inside (textfield, text area, checkbox). The UI becomes very messy when I add this field with unlimited cardinality to a ...
-2
votes
0answers
32 views

Render a block as HTML to store in an array in hook_preprocess_page

Edit: I've simplified my original question. I would like to render two blocks: Searchblock Language switcher block into a preprocess_page so I can pass the HTML to an array. Both 'content' values in ...
1
vote
1answer
56 views

Permanent Deleting of files still doesn't work for me (make_unused_managed_files_temporary = true)

make_unused_managed_files_temporary didn't work for me. I am using Drupal backend for the REST API frontend application. Thats how the File input looks (because I am not sure if that setting is for ...
0
votes
1answer
54 views

How do I remove part of the HTML markup?

In my Drupal 8 template, I use {{ product.variations }} which produces the following HTML markup. <div data-drupal-selector="edit-actions" class="form-actions js-form-wrapper form-...
0
votes
0answers
37 views

How to go back to the store in the product template?

In the product template, I can add the code below and display the store : {{ product.stores }} How to go up in the store to display the store fields. For example, how to display the currency of the ...
0
votes
0answers
56 views

Why do I get an error about the constant SODIUM_LIBRARY_VERSION not being found?

I'm on shared hosting, and I'm trying to install drupal 8 using composer. When I run composer create-project drupal/recommended-project:8.x-dev my_site_name_dir, I get this error. constant(): Couldn'...
0
votes
1answer
35 views

How to query only specific id's in a custom source plugin

I have 40/1040 source product_id's I need to ignore in one migration, so that I can put them in their own separate migration. I can exclude and include them in the yaml files, but it's a bit ugly and ...
0
votes
1answer
15 views

API error: “The 'administer nodes' permission is required.”

When sending a POST to Drupal 8's JSON:API (to create an entity) that references another content piece (linked by a UUID), I get the error: "The current user is not allowed to POST the selected ...
0
votes
1answer
18 views

Add author to a newly created node

When users sign up, I create a new node and add that user into one of the entity reference fields through rules. What I built so far is the following. After saving a new user event Create a new ...
1
vote
0answers
30 views

How to send send an image inside html email using swiftmailer?

in my Drupal 8 installation I'm using mailsystem module in combination with swiftmailer module. Everything works fine so far, my swiftmailer twig template inside the templates folder of my custom ...
1
vote
0answers
22 views

jquery.ui libraries-override > Incomplete library definition

I tried to remove the core jquery.ui theme.css by writing into mytheme.libraries.yml the following lines. libraries-override: core/jquery.ui: css: theme: assets/vendor/jquery.ui/...
0
votes
0answers
17 views

How can I rename the “Add Row” text on the button inside TableField

I'm using the TableField module to allow users to add themselves as entrants to a running race. I'd like to change the standard button text from "Add Row" to "Add Entrant". I've ...
0
votes
0answers
19 views

How to download bulma sass file an compile in order to change the primary font?

I'd like to change the primary font in Bulma as per https://stackoverflow.com/questions/64512940/setting-a-new-primary-font-family-with-bulma. I've used composer to install libraries_provider ...
0
votes
0answers
21 views

Adding a Javascript library

I apologize for asking this for the 100th time but I just cannot understand the previous answers. There are 2 modules (form placeholder and chosen)where cannot get their libraries included. Step 1: ...
1
vote
1answer
35 views

Media library widget: Table instead of grid?

Background I have a multiple-value entity reference field with target type = media. It is used for "document" media, so mostly pdf files. I am using the "Media library" widget ...
0
votes
0answers
12 views

Hide a block from the “Place block” list

I have a custom module that defines a series of blocks. Depending on the configuration of the module, I'd like to hide blocks from "Place block" block layout list unless they're enabled. Is ...
0
votes
0answers
23 views

Create Paragraph Type Programmatically

I've looked around on Google to see if anyone has detailed how to extend Paragraphs and create a new Paragraph Type programmatically. I'm sure it roughly follows creating a new Entity type ...
0
votes
0answers
16 views

How to formatting line breaks in custom module's email body containing translatable plain text?

with my custom module I try to prepare an email body containing hard coded plain text. The text should be translatable and formatted with line breaks for a nicer output. The text is prepared in my ...
0
votes
1answer
16 views

Display images as a form element in a webform

The goal is quite simple – I'm looking for a way to display an image in a webform. By that I mean the image would part of the webform as a complement to a question (example: "what color is the ...
0
votes
1answer
26 views

How to iterate multi dimensional array and pipe each sub array to another plugin as input in Migration yml

I am migrating CSV data into Nodes and Paragraphs in Drupal 8. I have field in CSV file which has JSON data, I have written a process plugin to convert JSON data to multi-dimensional array. I would ...
0
votes
1answer
40 views

How to write custom access for a route which redirects the user to another route if a condition is true

If I visit example.route.one and certain conditions are fulfilled I want to redirect it to example.route.two OR else access should be allowed. How Can I achieve this? I tried writing the redirection ...
0
votes
1answer
30 views

How do I get the current URL in a rule?

I am trying to make a Rule where after the user logs in they are redirected to the front page except when they are setting their first time password or resetting their password To do it I want to use ...
0
votes
1answer
37 views

How to display a message according to the country of the store?

On Drupal 8, I installed Drupal Commerce 2 I want to modify the TWIG file of the products to show "Made in France", if the store country is France and made in Belgium, if the store country ...
2
votes
0answers
35 views

How to avoid data loss for non translatable fields if original language is deleted?

A small scenario to describe an issue: I have a CONTENT TYPE with 5 fields. Steps followed: Go to admin/config/regional/content-language. Enable translation for only 2 fields. Then created a node in ...
1
vote
0answers
20 views

“Display” checkbox to show/hide media reference field items?

Background In Drupal 7, a file field does have a "Display" checkbox per field item, to show / hide the respective file. In a Drupal 8 migration project, we are migrating such fields as ...
0
votes
2answers
20 views

Theming a views field with template

Apologies if there is a good documentation out there, I searched and read other topics for over 30 minutes now, could not figure it multiple things with theming a field. My objective is to customize a ...
-2
votes
0answers
21 views

Load locally and external libraries

Thank'us for your answers!! I'm working at drupal 8, with a Subtheme of Bartik. I would like to use bootstrap and animate_css. I try to install the modules, i try to add to mi *.libraries.yml, i try ...
-2
votes
0answers
15 views

Twig syntax error page temporarily unavilable

I have Drupal Lightning profile on site Drupal core 8.1.8. I am using efrom to add data when I click the button to add data error in recent log is Twig\Error\SyntaxError: An exception has been thrown ...
0
votes
0answers
19 views

Trying to do A/B testing with Webform

I'd like my webform to change a hidden randomly on every load. Here are the relevant parts of the webform I set up, with a textfield instead of a hidden for now so I can see what's going on, but I ...