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.

0
votes
0answers
2 views

Use Token in twig template

I would like to use the token [paragraph.field_zwischenseite_link] in my twig template to link my parent div. Unfortunately I get the error Message "The website encountered an unexpected error. Please ...
0
votes
0answers
13 views
+50

View display plugin “entity reference” not using translation

For some of my entity reference fields I'm using "Views: Filter by an entity reference views" as reference method. I've configured those views to use the current interface language for rendering (with ...
1
vote
2answers
677 views

Theme a node form

I'm attempting to theme a node add form for my new slide show content type in D8 using an example for D7 that I found here, but I'm not having much luck. I've made and enabled a module named ...
0
votes
3answers
883 views

Programmatically node update while saving node

How can I update the value of the field in the nodes while save/update the node? When you save/update the node value from the field was taken and save in the same field in the other nodes. I tried to ...
0
votes
0answers
12 views

How to prevent views to replace single quotes with double quotes in HTML output?

I'm using the rewrite option of a view field to generate some HTML. One tag has a data attribute, which should contain an array for later use in JavaScript with JSON.parse(): <div data-image-src='{...
1
vote
2answers
59 views

Get Current User Last Node Access Timestamp Per Node

Drupal 8.x I am trying to compare the current users last access timestamp to other timestamp values and am wondering how to get the current users "last_access" in HOOK_preprocess_node(). MYMODULE....
0
votes
1answer
19 views

Show multiple term references as ID in one row

I've got a view of nodes, displayed as fields. As each node may have references to multiple terms/tags, I would like to show all these tags. When I use field "term_node_tid", then I get the multiple ...
0
votes
1answer
652 views

How to filter entities in View by all of their taxonomy term reference fields?

Let's say I have a custom entity that has two taxonomy reference fields: categories and tags. And I want to display all entities that have taxonomy term with id 1. The term is a dynamic value(...
0
votes
2answers
85 views
+50

Add class to form-tag in in views exposed form via template_preprocess_views_exposed_form()

I wonder how I can add a class to the form tag (of the _search_content_ view's) exposed form using template_preprocess_views_exposed_form() (or even better ...
0
votes
0answers
30 views

main menu link as language switcher

I have 2 language and these situation: main menu -> lang1 -> link to www.foo.com/ main menu -> lang2 -> link to www.foo.com/en All sites when switch manually on browser the language, But my main ...
3
votes
0answers
14 views

Migrate - Multiple Source Items per Row

I'm migrating content from a Joomla SQL source. The images are stored inside of the text as inline images. This is how my source data looks like: +------------+--------------------------------------...
0
votes
0answers
8 views

EntityReferenceSelection plugin ignored

I am trying to create a simple time tracking app and for this purpose, I need an entity reference field with some additional filtering of referenced entities (only active projects can be selected). I ...
0
votes
2answers
46 views

Moving the Sites/Default/Files Directory

We have a client with simple request to move the Public File folder up simply so that links will be shorter like example.com/files/ instead of example.com/sites/default/files/. I assumed this would ...
-3
votes
2answers
35 views

How to change the background color of blocks? [on hold]

I just want to change the background color of a block on the “Sidebar First” region in Drupal 8. How can I do that?
0
votes
2answers
902 views

How to sort by condition in entityQuery

I want to get a list that the items with a specific term in the top (like promote). The query would be like: $query = \Drupal::entityQuery('node') ->condition('status', 1) ->condition('type'...
1
vote
1answer
16 views

How to create a view to count comments per user?

I am trying to create a view with a table that shows all the users and the total number of comments that user posted in descending order. I am not sure what I am doing wrong but I spent hours on this ...
0
votes
1answer
220 views

How to correctly use cookies? (Twig and cache context)

In my current project I need to alter node templates depending on previously visited landing page. My idea is that, when a visitor visits one of these landing pages, a cookie will be set, and ...
1
vote
1answer
751 views

How to add twig code in View 'global custom text' field?

I want to add if condition in my "global custom text" field saying if node is published, print some link. I tried below steps , but it is not working: 1.I have added "Content: Publishing status" field ...
1
vote
3answers
2k views

Cache in hook preprocess page

I'm trying to get a value of GET variable in hook_preprocess_page(), but I'm having problems with the cache. Only the first time the code is executed, I can get the value of the variable to put it in ...
-1
votes
0answers
36 views

How would we strip html tags for the views exposed filter without using the raw filter?

Using the following example below, we are trying to display a view that has the following twig template (views-view--myview.html.twig) and exposed filters. There is a need to remove all html tags ...
2
votes
1answer
107 views

Changing Twig template of form items through the theme

I have a block, which renders out a form using code that looks like this: {{ attribute(form.facets, 'filter_' ~ filter.name) }} I'd like to amend the markup and CSS classes for the various elements ...
1
vote
1answer
81 views

How to pass variable of paragraphs type to another preprocess function

I want to override the fontawesomeicons.html.twig (Fontawesome Module). But I only want to do this for "my-very-special-paragraphs-type" and not in general. I think it is a good idea to declare a ...
0
votes
0answers
29 views

View Fields twig: How to get taxonomy terms for field?

I have a view fields hook that is listing content in twig. From those fields, I am able to retrieve other fields like text. {{ fields.field_teaser.content }} I am unable to get the taxonomy terms ...
0
votes
0answers
48 views

How to export images [on hold]

What I try to do is to transfer some nodes from a d8 site to another d8 site. I tried the node export module though is still in development. My problem is that I can't pass the images from image ...
0
votes
1answer
26 views

Where are the Views located?

This is related to this question I asked. Bottom line is that for some reason some junk view is stuck under the Views list and when accessing the List I get a WSOD. I confirmed that is a view issue ...
1
vote
2answers
710 views

How to use password policy module

I just installed and configured Password policy module, but the constraints like password length should be minimum 8 characters is not reflecting when a system admin adds a new user and creates an one ...
0
votes
1answer
35 views

How to pass values or data from a page to a webform using webform link field?

If we have a link to a webform in a content type and we need to pass data or values to that webform from the fields available from the content type. How do we achieve this. I'm using webform 8.x-5 I ...
0
votes
2answers
695 views

Ajax error on node form edit page

I'm trying to ajaxify part of node form. I have a hook_form_alter that adds extra ajax property to a widget of select field. The problem I'm facing is the callback method / function, which is not ...
2
votes
1answer
667 views

Display field collection items by using twig

I'm using the field collection module in Drupal 8 to encapsulate event informations so I've got a field collection with six sub fields (place, starting time, etc.). In my twig template field--field-...
0
votes
3answers
1k views

SMTP Module not sending email

Using XAMPP on Mac I have installed https://www.drupal.org/project/smtp After setting up admin/config/system/smtp It gives above error. Unable to send test email. Do we have to any setting on ...
0
votes
0answers
11 views

How to bulk update (delete) Product Variations

I want to bulk select product variations for deletion, just like we can do with content and products in admin. I tried to duplicate the products admin view, and also creating my own, both throw ...
0
votes
0answers
10 views

Extend Updater class to specify install directory

I'm trying to port 'module_install' module from drupal 7 to 8, which installs a module in a specific directory. To specific the install directory, the module creates a class which extends from ...
-2
votes
0answers
27 views

Where does the stripping happen when you change text formats? [on hold]

I need to know where the code is that strips formats when you change from HTML to rich text or vice versa in the ckeditor that is in drupal 8. I need to modify what it strips. Where can i find that ?...
1
vote
1answer
1k views

How do I use Bootstrap scrollspy?

I would like to use Bootstrap's scrollspy plugin in Drupal 8. So I edited the html.html.twig file replacing <body{{ attributes.addClass(body_classes) }}> With <body{{ attributes.addClass(...
2
votes
1answer
754 views

Can we fetch the depth of taxonomy from term load

Term::load (termid) can we get the depth of term. If yes how can we achieve ? If no, how can we achieve this without loading tree nor children is there any other way we can fetch depth?
-2
votes
1answer
41 views

Is it possible to build a brand new theme without using Twig? [on hold]

I'd like to move to Drupal 8 for my next project. I understand that, from version 8, Drupal standard template engine is Twig. Is it possible to build a brand new Drupal 8 theme without using Twig at ...
0
votes
3answers
1k views

Creating media_bundle entities programatically

I am still trying to wrap my head around some of the D8 things. Working with some media bundles like media_audio_bundle and need to write some migration scripts. I have spent couple of days now ...
0
votes
1answer
626 views

Using cache for twig variables in preprocess function

I implement a menu on a region using a preprocess function to get a link with an anchor for each block of it with a title. I made a preprocess function for region, in my theme, where I test the region ...
1
vote
1answer
716 views

How to access an entity loaded out of the cache

I am working on a Drupal 8 modules which should push a http response header based on a value stored in an entity or a list of entities. The module was originally done for D7 and now is in porting up ...
0
votes
0answers
10 views

Are there any “taxonomies views bulk operations”?

I have created a view with list of taxonomies and I would like to print them using "Entity Print" module. With the view that contains list of nodes it is pretty easy, as Drupal has built-in "node ...
7
votes
5answers
7k views

How do I get the node type label from a node object?

I'm trying to get the bundle label (node type label) of the node from a node object in Drupal 8. This works, but seems long-winded: $node_type = \Drupal::entityManager()->getStorage('node_type')-&...
1
vote
1answer
24 views

Set entity reference revision field value?

How do I set entity reference revision value for a field? I have two fields, field_test_entity_reference and field_test_entity_revision. field_test_entity_reference is of field type entity reference ...
-1
votes
0answers
27 views

Install Drush 9 with Composer [on hold]

Ran this command (got no errors): composer global require drush/drush:9.* Then cd to /var/www/site.com/htdocs/ and run drush status, it gives: -bash: /usr/local/bin/drush: No such file or directory....
0
votes
1answer
48 views

Changing library path with hook_library_info_alter

I am having difficulties to change the library path defined by another module in *.libraries.yml via hook_library_info_alter Essentially I have one module defining a library component in its *....
1
vote
2answers
39 views

Load library dynamically depending on settings

My theme has a few settings that can be adjusted, one of them is style. I want to load the libraries depending on the styles, but without writing them in the .libraries.yml function ...
0
votes
0answers
21 views

Pathauto doesn't take into account my routing file [on hold]

I try to redirect my taxonomy pages to my own url pages. For instance, I want to change urls like "taxonomy/term/id" to something like "realisations/categories/termName-termId" So I went to create ...
2
votes
2answers
1k views

Regenerate image styles

I'm currently using Drupal 8.2.3 for my website design. My aim is to use it for publishing my blogs to social media sites, such as Facebook, Twitter, LinkedIN, etc. With that in mind, i'm using image ...
-2
votes
0answers
11 views

Uninstall issue for Entity Reference Revisions module [on hold]

I am trying to uninstall the entity reference revision module and I am unable to select the uninstall checkbox even though it is already installed. Below are the screenshots
-1
votes
1answer
22 views

Display an uploaded image in a webform, rather than the filename

Background: I'm using the profile module to hold user data but that makes an unpleasant UX for updating user info. So I'm using a single-page webform to offer the editable user data. The user data is ...
0
votes
0answers
24 views

WSOD on views list page

I get WSOD when I try to access the views page (admin/structure/views). I get the notice below in the error log followed by the error. Notice: Undefined index: id in Drupal\Core\Config\Entity\Query\...