All Questions

-2
votes
0answers
6 views

Create a Drupal 8 profile installer 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/...
1
vote
1answer
22 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 ...
-2
votes
0answers
8 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 ...
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
8 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 ...
0
votes
0answers
3 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
8 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
14 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 ...
0
votes
1answer
28 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
20 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
23 views

Using ImageStyle with dependency injection

Is there a way to use the ImageStyle class with dependency injection instead of a static call? I am struggling to find an example. At the moment I have a block which is importing the class with ...
0
votes
1answer
28 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 -...
1
vote
1answer
18 views

Are changes to the user status stored somewhere?

I've made a pretty serious error of judgement creating a view for a client that shows users created before a date AND still active. The error was adding a date filter. This was meant to be used at ...
0
votes
1answer
23 views

How to print the URL path of a referenced node using paragraphs?

I'm trying to print out the url path of a node from a referenced entity paragraph field in my twig template however have not had any success so far. I have tried various common twig functions but with ...
0
votes
0answers
33 views

How do you get and submit a webform in React?

I am planning to build a Drupal 8 site fully decoupled using Gatsby (a site generator for React). So I will use Drupal only to structure (content types, paragraphs), enter and update all the content ...
0
votes
0answers
18 views

after adding target=_blank file is still opening in new window. So to override file.js [on hold]

I have added window.open(jQuery(".form-managed-file a").href, '_blank'); in jQuery but still file is opening in new window instead of new tab. How can we override below event of file.js function(...
0
votes
0answers
11 views

Conditional Fields inside Paragraphs not working

Am able to get the configured conditional fields in hook_field_widget_WIDGET_TYPE_form_alter() and trying to apply them for Paragraph fields but not working, below is the code(most of it copied from ...
0
votes
1answer
17 views

How to define allowed file extensions to file field in installer yaml?

I need to add 2 fields to an existing content type in Drupal 8 website, one is text another is file type, I have a multisite setup so I need to add for every locale site, Now I have created a module ...
0
votes
0answers
9 views

Subrequests: Assigning Paragraphs entity to node

Migrating a content type from D7 into a greenfield D8 app, so I'm using Subrequests and jsonapi modules. My first subrequest to create a simple Paragraph returns the new ID and it properly replaces my ...
0
votes
0answers
11 views

Can I combine multiple “no results behavior” to avoid repetition?

I have a Search API view that has 3 attachments. This is so I can display different content type results with unique layouts. If the user searches something too specific, they'll see the No Results ...
0
votes
0answers
10 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
0answers
16 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
0answers
4 views

multiple view block by term that list node title tagged with child term

I want to display a view where multiple block are specific to first level term of a vocabulary and that it list all the node tagged with all the child term of that term with deep. I could create each ...
0
votes
0answers
10 views

Automatically add meta tags on node creation

I'm currently maintaining a lot of different sites containing the same information pages (example: profile pages with the same content but on different sites/base URL) and I'd like to consolidate this ...
-1
votes
1answer
22 views

Drupal maintenance over several environments

I have a production environment for a Drupal 7 site. This environment is replicated to a staging environment, which we use for testing updates to modules and drupal core (same major version). We ...
0
votes
0answers
19 views

Provide autocomplete field with user's Display Name

Drupal core already supports autocompletion of username fields. However is there a way to provide autocomplete for user's Display Name? Since this is a virtual field, a database query with % like ...
0
votes
0answers
21 views

Render content type display mode in custom module [duplicate]

I'm facing the issue with rendering content type in specified display mode (teaser) in my custom module. I have a module which stores NIDs in session, and when user enters specific page, I want to ...
0
votes
0answers
9 views

How to implement a price resolved Commerce 2 adjust the prices of items already in the cart?

I have a custom PriceResolverInterface to calculate discounts based on quantities. However, the returned, adjusted price only affects the item(s) currently being added to the cart and does not adjust ...
1
vote
0answers
12 views

behavior of path on unpublished/draft nodes

We have a Drupal 8 site with a press releases page. Currently the press releases page is provided by a view with a page display. The path in the page display is set to /press-releases. I've been ...
0
votes
1answer
16 views

Add link for each column

I'm working on tripal with drupal 7.x I have created new view. i had chosen the fields and i have this table. i want to add the link for each row of the column map Name. i put this tag but i want ...
0
votes
1answer
53 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
0answers
42 views

How to stop a local database from launching the online website?

I'm a designer and new to Drupal. been studying for a couple of months creating sites for personal learning. I started working in a company that had a Drupal 7 website. I studied, learned it and ...
0
votes
0answers
39 views

How do I differentiate between different node dates?

A site owner wants to differentiate between semantically different dates of articles published on their Drupal site as follows: Editorial changes on an article will NOT create a new revision. Content ...
0
votes
1answer
15 views

override view Use administration toolbar

i have a view that using administration toolbar. Problemis theme suggestion is not showing the template names that should override the template. i guess because its using the administration toolbar .. ...
0
votes
0answers
43 views

Drupal 8 - How to setup local development environment? [on hold]

I need to setup local development environment for existing Drupal 8 site. I was provided its codebase including sites files and db dump. Please help me how I can setup local development environment ...
0
votes
0answers
50 views

How to add mutiple fields together in node form

I have a requirement to add more multiple fields together in add-another-button click (fields in node form). Actually Field collection module will solve my issue. But the field collection module will ...
0
votes
1answer
26 views

How to print the URL of a title field?

I'm trying to print out the url path from the title in my twig template however I haven't been successful so far. Printing out the title containing the link works fine using: {{content.title}} ...
1
vote
1answer
38 views

How to use hook_prepare to modify a field of a node before it is edited

I want to modify the contents of a field of an Article node just before it comes up for editing. I have read the documentation at http://api.hostdog.gr/api/drupal-8/drupal%21core%21modules%21node%...
0
votes
1answer
27 views

Custom Page routing

I created a custom page type called 'Angular page' and a custom twig template for it which loads my angular scripts and prints the <app-root> tag. I set the page URL to /angularpage and the ...
0
votes
1answer
35 views

How to create unique banner for each node and views page?

What I am trying to achieve: I want the unique banner image for each node and the views page, where the site administrator can simply upload the image and description to upload the banner for each ...
1
vote
1answer
40 views

In code, only create a revision if a field is changed

I have a custom revisionable entity with a few dozen fields. I'm importing data about the entity on a periodic basis. If the entity has changed, I'd like to save it and create a new revision. $dogs =...
0
votes
0answers
21 views

Update to drupal 8.7 caused paragraphs to display improperly

I am using bootstrap paragraphs (BP) as part of my project. When I updated to D8.7, the BPs that define layout (e.g. 2 column, accordion, etc.) stopped displaying. I then tried a roll back to 8.6 ...
0
votes
0answers
11 views

Comment body not displaying

I have an interesting problem where the comment body does not appear with the comment. The field wrapping is in the HTML but the content portion is always blank. This problem occurs regardless of the ...
0
votes
1answer
40 views

Entity getOwner()

In what table does an entity "foo" get its metadata stored? In Drupal 7, there are tables for all the fields for a content type and the node table had some metadata stored, but most data for a content ...
1
vote
1answer
19 views

Is the homepage considered in_active_trail?

I'm learning Drupal 8, so still very new to it. I'm working on customizing the main menu. I've been able to add Twitter Bootstrap to my custom theme. I've made a custom menu--main.html.twig file. I'...
-1
votes
0answers
27 views

Export / Import Users Drupal 8

I am loking for a way to export users from one Drupal 8 Site into another Drupal 8 site. Is it possible to do this by exporting and importing the Users tables? If so which ones? I see there are ...
-1
votes
0answers
27 views

Need to force session restart

I've created a simple site that controls sign displays and the manufacturer tells me that in order for the signs to pick up changes, I need to force a session restart. I've installed the ...
0
votes
0answers
15 views

entity_lookup for user entity type

I'm trying to link a field in my spreadsheet file to a user that is previously created with a migration from the same spreadsheet. The Backup column consists of multiple names divided by the backward ...
-1
votes
0answers
15 views

Provide a field that lets editor select content types?

I have a Paragraph that when rendered, injects a View. This view is being built and constructed in a preprocess hook in the theme, with arguments injected from a field. The field just lists all the ...
-2
votes
0answers
21 views

How to move multiple nodes to another user [on hold]

Answering my own question. For example with code. $node = '30837,30845,30850'; $nodes = explode(",", $node); foreach($nodes as $nid){ $node = node_load($nid); // If you want to make sure ...

15 30 50 per page