All Questions

0
votes
0answers
3 views

How to print the relative url or node id for each referenced node in twig?

I am using paragraphs to render a number of nodes on a page. The nodes are obtained through an entity reference field called 'field_nodeslist' in my cards paragraph type. The cards are then rendered ...
0
votes
1answer
36 views

How to access all the parameters in URL without getting a “page not found” error? [on hold]

I used this code in Drupal 7 can access all parameter. Example: $items['hello'] = array( 'page callback' => 'hello_handler', 'title' => 'Hello page', '...
0
votes
0answers
3 views

How do I turn off mobile menu collapse for bootstrap 3 theme in drupal 8?

I am looking to use a different mobile menu solution and replace the default bootstrap 3 mobile menu. How can I turn off the bootstrap collapsed mobile menu function?
0
votes
1answer
22 views

Adding a script to certain pages

I am trying to add a script code on all but few pages. I tried the following code on the template.php bfile, but it doesn't work. function THEME_preprocess_page(&$variables) { if (isset($...
0
votes
1answer
580 views

How to turn off panels in-place edit bar

I know this maybe a silly question but how do you hide panels in-place editor bar?(The bar that has layout adjustment buttons.) I found a post that said there's a on/off setting on general settings ...
0
votes
0answers
4 views

I want to use drupal_get_token function at drupal 8 , but drupal_get_token is not available for D8

I want to use drupal_get_token function at drupal 8 , but drupal_get_token is not available for D8 . I need the alternative of drupal_get_token at drupal 8. drupal_get_token('arg1') used in ...
0
votes
1answer
530 views

commerce_customer_address

I am using Commerce Kirckstart installation. I would like to change a field in commerce_customer_address. I only want a new field, like telephone and I would like to remove State. Some one knows how ...
0
votes
0answers
4 views

How to migrate file uploads from Drupal 6 to 8?

I'm working on a custom migration from Drupal 6 to Drupal 8. Some of the content types have a field used for file attachments. In Drupal 8 this field has the internal name field_attachments. When I ...
2
votes
1answer
347 views

How to use another php version for drush 9?

On live server I use differents drush and php versions for drupal 8.4 and 7. I install drush 9 to ~/drush9 directory with composer require drush/drush:9.* command. On dev server and drupal 8.4 I use ...
0
votes
0answers
7 views

8: Datetime field show different format browser wise

I have tried https://www.drupal.org/project/webform/issues/2990482 https://www.drupal.org/project/drupal/issues/2791693 For Drupal 8.6.3, but it's not working.
0
votes
1answer
644 views

Theming custom block type have multiple paragraph field

I've created a custom block type includes a paragraph type field and make it multiple. I've configured this block to display it only on the front page. I have a page--front.html.twig template in my ...
0
votes
1answer
5 views

Excluding inline images in views

I have a node type with an image field and insert button to get the image into the text field. Then there is a view that is getting the content of the text field and shortening it to 150 characters. ...
2
votes
2answers
460 views

How to make a theme hook suggestion for menu according to region?

I'm placing the same menu block in two different regions whereas different html markup for the list is needed. So analog to my previous question "How to make a theme hook suggestion for blocks ...
1
vote
1answer
538 views

drupal commerce : add form between shipping method selection and order review

I'm coding a custom module to make shipping by a delivery entreprise which is not having module compatible with drupal commerce. So, I give choice to customer between 2 shipping methods : colissimo( ...
-3
votes
2answers
21 views

Create an install profile with a config export

I want to create a Drupal 8 profile installer with a config export, to export regulary my config to push data modifications in git. I tried this tutorial: https://www.valuebound.com/resources/blog/...
0
votes
0answers
8 views

loop through paragraphs ID's in node template

In a custom twig template for content type "legal", I'm trying to loop through a 3-field paragraph called "legal_section." It's referenced by my content type, using an entity reference field called "...
-1
votes
1answer
18 views

Custom search function with result from external url

I need to create a page in Drupal 8 where there is a text field and a search button. When the user has entered a word to search and hit the search button a list with a search result should be ...
1
vote
1answer
342 views

Google Store Locator

I have installed this module on a clean Drupal 7 installation. But I can't activate the Google API. I have added the API key in the GEOCODE field. But I still get the error. Also I got a blanc screen ...
19
votes
6answers
20k views

How do I render a form?

What is the alternative to drupal_get_form('user_login'). in Drupal 8? I am using the following code in theme_name.theme, but it doesn't work. // Include namespace for userLoginForm. use \Drupal\...
0
votes
1answer
12 views

How to add the view name as body class

function THEMENAME_preprocess_views_view(&$variables){ $view = $variables['view']; if($view->name == "YOUR_VIEW_NAME" && $view->current_display == "MACHINE_NAME_OF_VIEW"...
0
votes
1answer
21 views

Hook for Node Add Field?

For my use case, this question revolves around the entities node and paragraph. Fields in my projects are created under the following structure: content_h2 paragraph_h2 content_p paragraph_p ... ...
1
vote
1answer
608 views

How can I make a template for a product type in Commerce?

I want to be able to write my own markup for the fields (see image below) of each product type – how do I do this? My main reason for this is that I want to group them with my own HTML rather than the ...
0
votes
1answer
17 views

How to show contextual links / quick edit links for blocks

I'm building a Drupal 8 template/theme from scratch, and it is not showing the contextual editing options for my blocks when I view a site page. I.E., the little circles that are clicked to see ...
0
votes
1answer
553 views

Redirect a view page to another view page with arguments in the url

I have a custom view with button in the main tab placed in the local_task tab bar area (Outcomes). I have sub local_task navigation items under that as well that are regular drupal views. (See below) ...
0
votes
1answer
10 views

Override view-list and get items properties

I'm currently working on Bartik theme and i'm trying to create a custom template for the Content-Recent block available in Drupal 8 For your information, i would like to create the following block ...
0
votes
0answers
16 views

View filter settings not selected properly in production environment

I have a group of block views for various program pages on my site which have a filter for an area of interest. Within my "Area of Interest" taxonomy term are numerous areas for the different groups. ...
0
votes
0answers
7 views

How to solve this Webform conditional rules?

I have a webform with 4 Radio button - 1, 2 , 3, 4 & 4 field sets - Person1, person2, person3, Person4 What I am trying to achieve, if I select - Radio 1 - Person1 field set would show - Radio ...
1
vote
1answer
33 views

Why return AccessResult::allowed() ends up with “Access denied”?

I'm having a strange behaviour while trying to use hook_node_access in Drupal 8 (Lightning to be more precise) and I can't figure out why is doing this. Let's suppose that I want to always allow ...
0
votes
1answer
686 views

Add classes to programmatically added fields

I have programmatically created a few content types and fields for said content types in a module I'm building, but I need to add classes to said fields. So if I have a text field called "...
0
votes
1answer
66 views

Is there a better way to style fields?

I'm learning twig and using it to format and style my fields. The problem I am running into is that I need to create a new twig template for each individual field. In the example picture, I have ...
0
votes
3answers
340 views

How to get a list of Users as values for a select list field?

How do I get a list of users of a specified role to populate a select list in node/add/* ? For example when creating a piece of content I want a field "Select Your Moderator of Choice" and the ...
2
votes
1answer
2k views

How to use composer for installation profile?

I have a Drupal 8 installation profile with custom modules and themes and I am wondering how should I use composer so that I can run it and drupal core and other dependencies(like contrib modules) ...
1
vote
1answer
701 views

Get Order Object on Checkout Complete Page

I'm trying to develop a new module but just can't get the correct solution, I hope you can help me. On the checkout complete page i need the order object with all information of the just created ...
1
vote
1answer
342 views

How to load CSS files located outside Drupal's path from within a custom module?

I need to store my css files at a location outside Drupal's path (e.g. /srv/assets/css/my_site/general.css). I attempt to achieve this using drupal_add_css but the browser loads them from: http://www....
1
vote
0answers
21 views

kint() my_theme_preprocess_node error [on hold]

After using kint in my 'mytheme'.theme file to output the variables : function my_theme_preprocess_node(&$variables){ kint($variables); } I get the following error: RuntimeException: Failed ...
1
vote
1answer
579 views

Creating Two carousel in one page using jCarousel in drupal

I am trying to create 2 carousels in one page with jCarousel module. But the css is applied only to the first carousel and second is appearing as normal ul li tags. Can someone help me in resolving ...
2
votes
2answers
117 views
+100

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 ...
0
votes
1answer
127 views

How to add css files based on breakpoint in library?

We have the following mytheme.breakpoints.yml file and a simple library mylibrary that is added through our mytheme. Within the mylibrary there are two libraries, one that is optimized for desktop ...
1
vote
1answer
346 views

Content edit links?

I'm new to Drupal 8 and can't figure out a way to show the edit contextual links for content displayed through the Views module. This was simple in Drupal 7, but in Drupal 8, a view only shows the ...
0
votes
0answers
4 views

How can I include the email recipient in my webform VIEW

I am creating a view to show all webforms and some of the data included in the webforms. Is there a way to also pull the email recipient data? (Example: You create a webform, then click on "email" ...
0
votes
1answer
25 views

ThemeNegotiator not working for admin pages

I'm trying to use the ThemeNegotiator to change the theme of the add and edit pages of one content type. I've followed the following very extensive posts/blogs. Don't use admin theme for adding ...
1
vote
3answers
7k views

How to check a boolean value in twig templates?

We have a field_boolean (boolean field) on an ECK Bundle on the article content type. While doing research we came across this question, but does not solve my problem. What is the appropriate way to ...
0
votes
0answers
9 views

How to add custom action to OPERATION dropdown in comment page?

In /admin/content/comment page, under "OPERATIONS", there is a dropdown menu with edit and delete actions for each comment, how can I add a custom action, such as Email in the dropdown menu? Any help ...
0
votes
1answer
562 views

Computed value on multipage Webform

I have multipage webform. I want to compute the value of the component (Hidden -type) which is on the second page based on the data submitted on the first page. I'm using hook_form_alter and added my ...
0
votes
0answers
4 views

Show widget of count product only on the one view mode of product

How to show widget of count product only on the one view mode of product? Example: Show on the full mode, but hide on the teaser mode.
0
votes
0answers
13 views

How to show external PHP in custom module view?

I have created a custom module which contains the hook_block_view and inside that I'm calling a function which only has this code ( the data.php only contains html and php to print a table ): ...
0
votes
0answers
23 views

PHP error “'reusable' not found”

I've done a composer install of Drupal 8.7 on a live server (php 7.2); run install.php and all works fine, but when I drop that database and upload the database from local development (along with any ...
0
votes
1answer
11 views

How do I fix missing input fields in panels

The site I am working on is Drupal7 site, built of panels and pages, panelizer. Typical steps to edit, admin logs in, click on the "customize this page" button, various panels open up, click on the ...
1
vote
1answer
664 views

Regions do not display in “Demonstrate block regions”

I wonder why some regions of my theme don't display in section 'Demonstrate block rerions'. This happens with some themes which I downloaded from Drupal.org, for example with the Software theme. ...
0
votes
1answer
32 views

How can I add folders to my template directory and have Twig find them?

I was listening to a Drupal Developer on youtube and one of the suggestions he has, is that when you go into a template folder, create some subdirectories for easier management, like this: Templates -...

15 30 50 per page