All Questions

0
votes
1answer
346 views

Theming paragraph fields from entity reference in view

I have a view (Drupal 8) where I load my entity reference field (display hidden), with three fields from a Paragraph type and a certain custom display). The HTML markup looks like this now: <div ...
0
votes
1answer
918 views

Include Lead Forensics code in all pages

I'm trying to include the tracking code Lead Forensics gave me. The code is: <script type="text/javascript" src="http://www.path-trail.com/js/11111.js"></script> <noscript><img ...
2
votes
1answer
528 views

How can I display all levels in Simple hierarchical select

I created select hierarchy ( taxonomy with 3 level), but in default it shows only one level , how can I display all 3 level in default page? : -Any- + -Any- + -Any- I do not want it to automatically ...
0
votes
1answer
17 views

How to override ViewsExposedFilterBlock with my own class?

I want to add an additional form element in the configuration form for core/modules/views/src/Plugin/Block/ViewsExposedFilterBlock.php by adding public function buildConfigurationForm(array $form, ...
0
votes
1answer
464 views

How to change operator in schema.xml and configure site for AND search

I am using Solr search with drupal.Its working fine on my site but the problem is i needed the search to be a specific to the searched content. If i searched for "assembly and key",the search result ...
0
votes
1answer
27 views

Migration with duplicate entry error

I'm running migration in Drupal 8, but got a duplicate error below. SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '10b1b105-355b-3c77-8880-a0c247f826f3' for key '...
3
votes
1answer
1k views

Editor adds <p>&nbsp</p> on every enter

I've got a problem with CKEditor in Drupal 8. I've searched related questions like CKeditor adds extra <p> tags, but almost all questions are related to Drupal 7. So, my CKEditor automatically ...
24
votes
6answers
25k views

Programmatically attaching files

I have created the "Gallery" content type, and added two fields: "photo," and "document." I then used the following code for uploading a file in the "document" field: $file = file_save_upload('...
0
votes
2answers
480 views

REST API 401 Unauthorized

I am trying to create a new node with POST through REST in D8. I have enabled the relevant modules (hal, serialization, http basic authentication, Rest web services, rest ui) and added the required ...
0
votes
0answers
5 views

Creating nodes in Drupal 7 from an external REST API utilizing OAuth 2.0

I am using Drupal 7.67. I have a custom content type setup called Jobs. I need to interact with an external REST API and import jobs into Drupal. The company is called Bullhorn and it is a job ...
0
votes
0answers
4 views

Search API index one of many fields as one field

I have a site-wide search page that's powered by Search API and Search API Solr. It returns results straight from an index that contains content from various entity types (files, nodes, taxonomies, ...
-1
votes
1answer
25 views

Which hook can I use to retrieve form values after submitting a webform? [duplicate]

As the title suggests, I would like to know what is the correct hook for retrieving datas after a submission. The goal is to do a task based on the value of a data. Any help would be appreciated.
0
votes
0answers
9 views

Get price value in Webform submission

I'm trying to create a webform that has an entity selection element linked to an entity reference view that has a selection of products from the commerce module listed. So far this has all been ...
4
votes
1answer
517 views

How to fix “Unable to save a field collection item without a valid reference to a host entity” error?

I programmatically created a series of custom content entities which contain field collections. My site had an execution timeout error in the middle of entity creation and saving. I can not delete ...
5
votes
4answers
6k views

HTML isn't rendering, HTML tags are being printed

I added a view template views-view-fields--nieuws--page.html.twig to my theme. The template is correct, when I edit it I see the results on my website. {% for field in fields %} {{ field....
0
votes
1answer
511 views

How to load the immediate parent link in a preprocess function?

I am using menu block to show a section of the navigation. I have a requirement to show the parent link at the top, but that would not gel with the menu configuration. Therefore, I should be able to ...
0
votes
1answer
458 views

How to configure a Slideshow with thumbnails in modal window

I have tried to get the following scenario to work, with no success. I have 3 images. They are displayed in thumbnail form, in the bottom of a div. A main, preferred image, is displayed in a larger ...
1
vote
4answers
583 views

How to show sub-menu in a block in drupal 7?

I have a menu in Drupal 7 with 2 main links like home and about us, but I have 3 sub menu in about us like About us About Us 1 About Us 2 I need to show these 2 submenu in a block and show ...
-1
votes
0answers
8 views

PHP “Warning: Illegal string offset” error when looping through array from json_decode() [on hold]

I'm struggling to get 5 values from this multi-dimensional array as displayed from the json_decode() output below. Please see the variables in bold (or enclosed with double asterisks [**]) that I'm ...
0
votes
0answers
9 views

Alter Entity Reference data before view is rendered

I am attempting to work around a bug where an Entity Reference Field on User Account is saving duplicate references. I originally tried to remove any duplicates on the field by implementing ...
3
votes
2answers
455 views

How do I store large volumes or data points using Drupal ( temperature and humidity points )

I'm trying to use Drupal as a headless API, and so far I'm having good results. One of the things I'm collecting is a Temperature and Humidity data. Thus far I've created an entity that can hold the ...
0
votes
1answer
15 views

Change order of breadcrumbs elements in hook hook_system_breadcrumb_alter

I want to add another element to breadcrumb. I have: Home > Node Title I want to add another link between the two elements like: Home > Link to view > Node Title I have tried with ...
0
votes
1answer
428 views

Not able to make simple node path show up in “crumbs module”

I have read all the documentation, and I have been clicking about wildly for hours, and I have used the "debug" tab for the Crumbs module, and I still cannot get the simplest path to show up: Home > ...
0
votes
0answers
20 views

Need help with how custom fields are displayed by article.html.twig file

Noncoder here. After not poking my head under the hood of any CMS in years (not since Drupal 5, I think — and I wasn't very good at it even then), I'm working on a portfolio site. I suspect this ...
0
votes
0answers
11 views

Automatically generated <a> tags when rendering body content

My D7 creates anchor tags automatically when 'www.*****' in text is found. Example: <span class="class">www.site.com</span> produces <span class="class"><a href="www.site.com"...
0
votes
0answers
5 views

Set Default Value of User Entity Reference to logged in user

I have a Drupal 8 installation that has a user reference field and I would like the currently logged in user to be the default value for the field. I believe in Drupal 7 I would've used the [current-...
10
votes
1answer
3k views

What is the difference between {{ |t}} and {% trans %}?

I notice that Drupal 8 support {% trans %} which, according to the Symfony documentation (The i18n Extension), adds gettext support to Twig. {{ |t }}, as far as I know, is the legacy way to add ...
0
votes
1answer
39 views

Drupal 8 migrating json data with no array label

I'm learning how to create migrations in D8. However, I have this annoying issue where my migration is listed when I execute drush migrate-status but the total and unprocessed values are shown as N/A, ...
2
votes
3answers
2k views

Custom form submit handler is called, but node is not saved

There are many questions about a custom form submit handler not being called, but in my case, the handler is being called; however, the entity is not being saved. Specifically, I have a custom submit ...
0
votes
1answer
462 views

flexslider carousel using template.php

Views with flexslider takes lot of times in rendering items/images. Situation is like that , more than 5 flexslider carousel in front page. So I changed plan to go without view with flexslider. I am ...
0
votes
2answers
66 views

Delete files on rollback in Migrate?

I have a migration that pulls in a PDF with it and populates a content type. When I rollback the migration, it does not delete the PDFs with it. How can I tell a migration on rollback to clean up ...
0
votes
0answers
15 views

Modified user record during presave hook not saving properly

A project I am working on has a bug where an array field on the user object is getting duplicated values. To fix this bug, I am implementing the hook_user_presave hook in one of our custom modules to ...
0
votes
0answers
4 views

Configure ckeditor per field

I'm wanting to configure ckeditor via a custom plugin (adds a simple drop down of defined terms to insert into text), however, I need to know which field I'm editing so I can load the correct terms ...
0
votes
1answer
476 views

Multiple independent Views attachment pagers (load more)

I have a view with two attachments. I want to have a load more button to load items for each attachment and the main view separately, I have the load more module, but it loads more items for all the ...
2
votes
3answers
1k views

Dependency injection not working custom form

I have a custom module with a form class, where I am trying to inject a custom service to use within it's submit method: namespace Drupal\my_module\Form; use Drupal\Core\Form\FormBase; use Drupal\...
0
votes
0answers
9 views

Render image field with custom image style in custom block template

This is basically the same question as this, but I can't get the technique to work in a custom block type template: https://drupal.stackexchange.com/a/219052/71100 I have a custom block type called ...
1
vote
2answers
17 views

Entity access controler not called from custom route

I define a custom entity named "Politician", where I set the class PoliticianAccessControl as an access handler. This is working fine for the canonical url of the entity set in the following way: ...
0
votes
0answers
6 views

Ajax Checkbox option is not generating on change of radio button

foreach ($attribute_paragraph as $key => $single_attribute_paragraph) { // Load Attribute paragraph from database. $attribute_data = Paragraph::load( $single_attribute_paragraph['target_id'] );...
19
votes
6answers
20k views

Include a partial template

I'm trying to use Drupal 8, with a custom theme, due big structure differences for my requirements I have a page--front.twig.html and a page.twig.html, I would like to create template parts as used in ...
1
vote
1answer
18 views

How to delete paragraph when uninstalling the module?

I have been creating the custom module which have the paragraph configuration, when installing the custom module, the paragraph config will be stored in the database and then It will be available in ...
1
vote
1answer
11 views

Executing view twice with different filters returns same results

Here's my simple scenario : Execute view with exposed filter (min & max dates) If there are no results, execute again with min date = 0 to get all results Unfortunately, the query static cache ...
0
votes
1answer
66 views

Get difference between two dates programatically

In summary: On a Drupal 8 project, i am trying to programatically get the difference between two different times (current time - Node creation time) Use case: I have "nodeabc" already available on ...
0
votes
1answer
14 views

Giving access to specific roles just to edit the same page

I have Home page Departments Department A 1.pdf 2.pdf 3.pdf Department B 4.pdf 5.pdf 6.pdf Department C Department D page is created by admin.Is there any way to give access edit role based ...
2
votes
1answer
422 views

print theme_get_setting in php-as-css file

I'm trying to print out settings from my theme's theme-settings.php into a file called custom.php. Below is the code I'm using in custom.php: <?php header("Content-type: text/css; charset: UTF-...
0
votes
0answers
22 views

viewsreference child view Sample Code

Is there any example code for creating a new paragraph object with a viewsreference field and setting a view on the viewsreference field with its "type" and other display options set? Can't really ...
1
vote
1answer
457 views

Date with an option for end date being either a date or “ongoing”

I have a content type that contains relevant information of a project. It should hold the projects start date and the end date OR the status "ongoing". How do I make this happen? With the date field ...
-3
votes
0answers
18 views

What alternatives exist for node_type_delete in D8 [duplicate]

What alternative to node_type_delete('machine_name'); do we have for Drupal 8?
-1
votes
1answer
22 views

AJAX not working in views for anonymous users

I have a view in Drupal 8 with an exposed form with AJAX enabled. It works fine for admin user, but it doesn't for anonymous users. I have included in my theme libraries file: dependencies: - core/...
-2
votes
0answers
104 views

Migrate Filed Address Error ( Argument 2 passed to must be of the type array, null given) [closed]

id: address_field label: 'Custom migrate field address' source: plugin: d7_node process: 'field_address/country_code': plugin: default_value default_value: US 'field_address/langcode': ...
0
votes
2answers
439 views

How to restrict previous date display in custom forms?

I created a custom module for a form which accepts from date and to date as user input. I would like to restrict the user from selecting a date prior to current date. Code snippet of my code $form['...

15 30 50 per page