Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [8]

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

1
vote
1answer
122 views

Why is my theme library load on every page?

I'm beginning with D8, but I work a lot with D7 and Magento. I follow the developer documentation to add a library in my theme, and I don't understand why it's loading it on every page. I only want ...
-4
votes
0answers
30 views

How to add a CSS and JS from a contrib module to all pages of a site

I have International Phone Field module installed. Currently intlTelInput.css and intlTelInput.js is only available on pages which have an international phone field added through the back end. But I ...
0
votes
0answers
13 views

Webform submission tokens in emails

I am trying to print the webform submission label and value from tokens in confirmation email. The problem is that the label of the form element is not appearing, only the value. Tried with: [...
1
vote
0answers
32 views

Migration - Paragraph is not attaching to node content type

I have below code My data.csv id, title,location_place_1,location_address_1 1,"test","Test","India" /my-project/docroot/modules/custom/data_migrate/config/install/migrate_plus.migration.data.yml ...
0
votes
1answer
15 views

Change Product type's referenced Variation type

Once a Product type is created, I cannot change Variation type in Product type. Is this a feature, or is there a way to change it? Is it safe if I change it in the database? This is useful because I ...
0
votes
1answer
29 views

What is the easiest way to get the value of a string field in a twig template? [duplicate]

I'm using Drupal 8.5.4 and Bootstrap Paragraphs. I have a custom module foo and a custom paragraph type bar defined within. In the template for bar, I use kint to inspect the content of the variable. ...
0
votes
0answers
25 views

Group content is not saved

I altered the node creation form to allow me to select a group to assign the node to with this code: /* * Implements hook_ENTITY_TYPE_insert() */ function MYMODULE_node_insert(Node $node){ if ($...
0
votes
2answers
24 views

How to load absolute CSS and JS assets

I would like to load CSS and JS from https://static.example.com . The typical page contains: <link rel="stylesheet" href="/sites/default/files/css/css__wBfhyL83sORKzo__AgHv4HOGuOoSbIzIaa4clq9PXs....
0
votes
1answer
25 views

Multiple URLs for same node

anyone know how to create a URL alias and not redirect the user? I have a node with its alias set to /sign-up, but I also want it accessible via /caregiver/sign-up. I created a URL alias, but it seems ...
0
votes
0answers
7 views

print field value of content type

I have created a custom content type and created a page--home-services.html.twig template. How do I individually display the values of the fields I have specified when creating the content type?
0
votes
1answer
17 views

How to force child page added to book outline to top or bottom; update outline without clearing cache

Drupal 8. When you click the "Add child page" link at a book page, you go to "/node/add/content type" where you can create and save the child page. Upon return to the book page (assuming the book ...
0
votes
1answer
19 views

Webform CKEditor add color

I would like to add the possibility to change color in CKEditor, mainly for Webforms. The instructions at https://www.drupal.org/project/colorbutton suggest to download manually the CKEditor ...
0
votes
1answer
43 views

How do I manually group content?

I have created a wishlist in which those nodes are showing which are flagged, Wishlist working fine The next task is to create favorite groups. That is, the user must be able to create groups of ...
0
votes
0answers
9 views

Swap out Product_type images with Product_variation images

I want to be able to add images to both the Product type display node, and the individual variations. If there are no variations images, then show the product_type images, else show the ...
4
votes
3answers
74 views

How to clone a node without translations

I have a site with multiple language. Assume I have a node (nid = 1) with origin languages is en and translate to es. And I clone this node with code: $node = Node::load(1); $nodeDuplicate = $node-&...
0
votes
0answers
33 views

View results to show results in language of current page, but if no translation available show original language?

I need a view to display results based on the following: if the content has a translation available in the language of the current page, show that one if the content DOES NOT have a translation ...
0
votes
1answer
37 views

Link field title from entity/route

I have a Drupal link field configured to allow both internal and external links and have the title field enabled, but optional. I want users to be able to reference internal entities without having ...
0
votes
1answer
16 views

How to cancel an order transition if failure is detected in Commerce 2 / State Machine

I'm trying to plug into order transitions in order to send my order to a custom fulfillment system. I have a transition called "send_to_fulfillment", and order states "reviewing" and "...
1
vote
1answer
36 views

How to get term ID from translated term name?

I have a custom argument validator for Views, which expects a term name input and outputs the tid for the query. This works great in English, but I'm not sure what to do for translations. Is there any ...
0
votes
0answers
37 views

Use another image field in Metatag og:image when empty

My media type Image has two image fields: Image (required): media.image.field_image Image Facebook (optional): media.image.field_image_facebook Media type "Image" is referenced ...
2
votes
2answers
45 views

How to invoke a post drush command?

I am using Drush 9 and Drupal 8. When I execute drush site:install I find that it also modifies the permission of the web/site/default directory to r-xr-x--x, which troubles me delete that directory ...
0
votes
1answer
22 views

How to display the user's url in a template?

I created a template user-comment.html.twig to customize the rendering of the comments author. I can not display the user account url: user.url does not work. How to display the user's url in a ...
0
votes
1answer
88 views

Converting a drupal/drupal site to Work With Composer

At our company we have several sites that appear to have been made using the now deprecated method of composer create-project drupal/drupal. We've been fine using previously documented methods to ...
0
votes
0answers
21 views

How to add image field in a custom module form?

In our custom module, mymodule we have a form MyModuleForm where we want to allow for an image to be uploaded or chosen from already uploaded images. Below is the MyModuleForm.php file, but cannot ...
0
votes
1answer
23 views

How config the single page site module

I have installed the Single Page Site module and I was follow the instructions but still don't works for me. the module conf: Menu: main Menu class/id = #block-mainnavigation Menu item selector = "...
0
votes
1answer
32 views

How to move comments section out of its parent div

How can we move or override the placement of the comments in a node. Usually the comment section is placed inside its content div. My aim is to place this comment section out of its parent div which ...
0
votes
0answers
24 views

Comment file upload not working

Looks like we have two versions of jQuery loading. Hence the "(...).once is not a function" errors in the console. jquery.once is definitely loaded but only for the first version of jQuery. Nightmare....
0
votes
1answer
13 views

Views Geolocation field proximity: How to alter views field setting

I'm using a Geolocation field in views to order results by distance. The module provides a special views proximity plugin/field, which can be used in the "sort" section of the view. This plugin/field ...
2
votes
1answer
18 views

Multilingual REST export

I have Drupal 8 site which interacts with a React component. I want to expose one of my content type's content using REST export in views. How do I set views path to create REST export for ...
2
votes
1answer
22 views

Display block content in current language

I have multilingual Drupal 8 site. I want to display views block in home page. It should display block contents in current site language. Example: I have content type called "Book". Which has ...
-2
votes
0answers
32 views

Charting with about 700.000 nodes

I have a requirement to create website which its main functionality is to create charts based on nodes. The nodes will have 11 fields. The title, 8 decimal with precision of 1 and a reference field ...
-2
votes
1answer
36 views

How to create flag link views?

How to create flag link in views ? Is it possible to add flag link in views programatically ? In drupal 7 it was possible with views php field in such way <?php if ($node = ...
0
votes
1answer
20 views

Conditional email is not sent

I have configured an email handler with the condition that an email message must be sent when a submission is updated by filling an image file field (the image file field has to be "filled"), but ...
0
votes
0answers
38 views

Migration with paragraph issue

I have below file of code for paragraph migration. id: data label: Import data. migration_group: data_import source: # Refer to data_import migration group. destination: plugin: entity:node ...
1
vote
0answers
22 views

Can I remove dependencies from dependencies via composer?

If for example I have a distribution like thunder installed but I don’t want to have certain modules required via composer. Is there a way I can overwrite the dependencies of the distribution via my ...
-2
votes
0answers
23 views

Adblocker blocking ##sponsor-xxx DOM content that aren't ads. How to go about renaming files/references?

I've been tasked to change a site that we develop for a nonprofit org so that the content showing the sponsors isn't blocked. On loading, there's three DOM files that are being blocked: ##sponsor-logo,...
0
votes
0answers
10 views

ExternalAuth Table is Empty for SimpleSAMLphp_auth module

I'm using the simplesamlphp_auth module to integrate a SAML based IDP from my company. When a user logs in, their identifier (in this case their email) is checked against the authmap table. This ...
-2
votes
1answer
34 views

How tu setup magazine-like content type?

I working on my first Drupal 8 site, and I heard 3 rules about Content Types: More than 5 content types is too much When content are similar (news, articles) is better to do one content type Do not ...
-1
votes
1answer
45 views

jQuery on Twig Template [duplicate]

I am trying to create a basic jQuery function on my twig template but I can't seem to get it to work. Can someone please help me!? My Twig File is as follows: {% block javascripts %} {#if you ...
0
votes
2answers
34 views

How to remove exposed filter if value is supplied in url?

We have a view page (path = /some-path/) that has an exposed filter called category. The detailed view setup is below. How would we hide the exposed filter if it is supplied from the url? View setup: ...
-1
votes
0answers
17 views

Add Icons to Nav Menu

Is it possible to hide the HOME menu link (or any link on menu bar) with CSS and use the before pseudo element to add a Home icon from the fontawsome library? This is the icon I am trying to add. i ...
0
votes
1answer
29 views

How do I properly add a custom source for RSS feed import?

I am setting up the mappings for a Feed entity, but I cannot figure out how to properly set custom sources for fields. In this case, I am grabbing records from an XML document ("RSS/Atom" option) and ...
-4
votes
2answers
44 views

How to redirect user to login page when anonymous user click on the flag link?

Redirect user to login page when anonymous user click on the flag link. How to achive this? I have created flag links by function MYMODULE_preprocess_node(&$variables) { $node = $variables['...
0
votes
0answers
25 views

Proxy Subdomain and Base URL Problem For Multiple Sites

I have a proxy server that I need to set up to point to different application servers hosting Drupal sites depending on the path visited or on the subdomain. Say www.alpha.com is my default site ...
0
votes
1answer
44 views

Automating creation of a settings.php file in a version-agnostic way

To create a latest Drupal project with a local Drush I might do for example: drt=/var/www/html composer create-project drupal-composer/drupal-project "$drt" To create a Drupal settings.php for such ...
1
vote
1answer
41 views

Can't get value from cache_page table only cache_default

I am fiddling a bit with drupal 8 cache. Looking at cache_page table and there is clearly a value with CID i am trying to fetch. I try this. if ($item = \Drupal::cache()->get($cid)) { dsm($item);...
0
votes
1answer
32 views

How to force 403 or 404 on specific route

I have made a custom form to create nodes for a specific content type. Due to that, I want to throw a 403 or 404 on the admin page that creates new node. The route I mean is 'node/add/'. I guess in ...
1
vote
1answer
71 views

How can I mock a service?

i have this code: /** * Defines a wrapper target around a paragraph bundle's target field. * * @FeedsTarget( * id = "feeds_para_mapper_temp_target", * field_types = { * "...
0
votes
1answer
128 views

When visiting /user/ID how to allow users to only visit their own user page

I created a Twig template for the user account /user/ID page on Drupal 8. How to display this template only if it is the account page of the current user? For example if I go to the page of my ...
0
votes
0answers
35 views

Assign a controller to all book pages

I am trying to build a module that checks if user session set in all pages of a certain book. if the session is not set it will be set. I am using a sso system so the user data will come from there, ...