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
1answer
31 views

How to correctly configure Apache to remove /index.php/ from URL [on hold]

Drupal 8.6 setup with PHP 7.1 in centos 7 server. In httpd.conf I have below code. "water" is the root folder and docroot is the sub folder which has Drupal code DocumentRoot "/var/www/html/water" &...
0
votes
1answer
25 views

How to render a block in a template? [closed]

I installed the module "Shariff Social Media Buttons" for "Drupal 8" : https://www.drupal.org/project/shariff This module once installed, add a block in : /admin/structure/block I want to display ...
1
vote
0answers
38 views

What's the difference between adding a template and overriding a template, from a custom module?

I found a paragraph in the documentation about using template files in a custom module. This way can be even used to override a template like I did here. However, I am wondering if this is the ...
0
votes
1answer
50 views

Templates as content

I currently have a project with the requirement to edit templates for content like content, i.e. we will have a template content type which will be used as template for another content type. I've ...
0
votes
0answers
25 views

Deleted revisions still listed

I started dev on Drupal 8.6.0 and have since updated to 8.6.3. I have also cleared caches, run updates and cron. I have set up a content revisions view: FIELDS Content revision: Revision create time ...
0
votes
0answers
23 views

Rule to update or set value of a user custom field when creating a new node of a specific type

title just saying everything :) I need to a Rule that sets a value of users custom field (ex. field_custom) WHEN a new node of type (ex. page) is created/saved. For me it looks like I can only access ...
1
vote
1answer
66 views

Cache max-age doesn't correctly expire at midnight

I've got a node which cache should expire every day at midnight. Additionally I've a block showing the same node in another display mode, that also should expire every day at midnight. I thought this ...
0
votes
1answer
30 views

Based on user's country filter content of same country?

Please find my problem statement here: Show all contents of Type "Test" belongings to that country to corresponding user of that country My Approach: Created a taxonomy term of country, Mapped ...
0
votes
0answers
26 views

Read more links reference as node in views [closed]

Recently, I upgraded to Drupal 8.6.2 and struggled with the issue for read more links that references as eg: ../node/3145 instead of ../node/ within blocks. This is the code that refers to the links ...
-1
votes
0answers
19 views

How to include icon in module install page [duplicate]

I am creating a Custom module in Drupal 8 I want to show (like above pic) help, permission and configure I don't know to do this. help me to solve
3
votes
0answers
138 views

Change workflow transition state of translated node

I have a content node that has several translated nodes attached to it. My goal is to set the workflow transition state of translated nodes according to the state of the "original" node. The problem ...
0
votes
0answers
15 views

How to set a tab link which refers to a specific node?

I want to add a tab link in the login block (user/login). Like "Login", "Register", "Password reset" link. But my custom tab should link to a specific node. So I added this to my custom module (...
0
votes
0answers
22 views

How can I fetch the complete main navigation menu via JSON:API?

How can I fetch the complete main navigation menu via jsonapi? I've tried: curl --header 'Accept: application/vnd.api+json' https://cms.example.com/jsonapi/menu/menu/ and curl --header 'Accept: ...
0
votes
0answers
23 views

Duplicated content on multilingual site

I have a site which is bilingual (English, Greek). When I create a view with content, I get duplicate entries of the content. In the view under Rendering Language I have Interface text language ...
0
votes
1answer
19 views

Views filter criteria date field is greater than current date

I have a overview page with different events. Now it shows all events which were created. But I will that it just shows all the future events. The content type has a datefield for the eventdate. I ...
0
votes
0answers
24 views

How to change all that links of a custom entity content with (bundle) entity config

I generated (generate:entity:content) a custom entity content with (bundle) entity config, and in annotation I have links like: * links = { * "canonical" = "/admin/content/test_entity/{...
-1
votes
0answers
29 views

How to show progress bar in file field?

I have "Assessment" content type and having one field called "Goal Sheet" with type file. In this field I'm able to upload .xlsx, .zip formate. Here i want to show progress bar while uploading file. ...
0
votes
0answers
32 views

What's the correct way to create a custom formatter for a comment?

I'd like to create a custom formatter for the field Comments. My goal is to display a custom comments section beside CKEditor (URL /node/xx/edit). Following this article, I created my custom module: ...
0
votes
0answers
54 views

Throwing an AccessDeniedHttpException() in an event causes a “max nesting level” error

I am debugging an event subscriber that checks if a user has access based on certain conditions. If they don't have access, then I am doing: throw new AccessDeniedHttpException(); However, this was ...
0
votes
0answers
13 views

“Name already in use creating a field type” error

I'm currently having this error when trying to use a custom type (programmatically created), when saving a new field: Cannot declare class Drupal\mymodule\Plugin\Field\FieldType\MyFieldType, ...
1
vote
1answer
53 views

Dynamic local tasks - caching problems

I try to create some local second level tasks depending on some settings for a custom entity. But unfortunately sometimes these local tasks do not appear - they appear again when rebuilding caching ...
0
votes
0answers
22 views

use-ajax Class does not work if used in multiple views?

What seems like a pretty straight forward implementation of ajaxifying a link is not working if I use it in more than one view block on the page. I have a route that calls a function. In my view I ...
0
votes
1answer
30 views

save/get data from map field type

What I want to do is give a possibility to the user to save as many images as he likes. For this, I have created a specific field type $fields['photo_ids'] = BaseFieldDefinition::create('map') -...
0
votes
0answers
24 views

How to sort content by moderation state label?

I have moderation state column in my view (table display). When I sort the moderation state column it works as required and sorts by machine name. How can I sort by label instead of the machine name?
0
votes
1answer
35 views

How to validate allowed file types in custom module

I want to validate a field with accepted file type as PDF, XLS, JPEG, JPG, GIF, ZIP, RAR and PNG. I'm getting file types as PDF, XLS etc. here is part of my code. if ($fi_name!='') { if ($...
-2
votes
0answers
61 views

How do I add cities to counties?

which contains an event subscriber (the GreatBritainEventSubscriber class) that can be used to add additional information to countries, like counties or cities. I was able to add counties for a ...
0
votes
0answers
22 views

Change order of creation of 3 Custom Content Entity in one module whe install it

I created in one module 3 entities (in src/Entity) using that example https://www.drupal.org/node/2683569?no_cache=1543219315 First entity has a field of type entity_reference (...
0
votes
2answers
28 views

How can I override the sort variable?

For my view in Drupal 8 I have added a sorting criteria based on the custom field. Now, when I sort the content in the url one can see a sorting value as a name of that field. Like ?sort_by=...
0
votes
0answers
25 views

How do I get the paragraph fields values in hook_node_form_alter

I have a field named field_page_schedule which relates to an entity reference paragraph field and the paragraph has two fields named field_start_date_and_time & field_end_date_and_time. I need to ...
1
vote
5answers
174 views

hook to alter custom blocks?

I am having a problem with my custom blocks rendering, and I want to programmatically manipulate the blocks to troubleshoot the issue. I used this question to add this hook to my module: function ...
0
votes
0answers
29 views

How can I change the user login path to hide the login page

I would like to hide the login page so that it can't be opened by /user/login anymore and instead only by a 'hidden' path e.g. /customer-administration/login. I only want users who know the path to be ...
0
votes
1answer
39 views

Can Display Suite be used for “Show: Fields” as well as “Show: Content” to be able to rewrite field output?

I need to be able to adjust field output in view results but also want to make use of Display Suite for layout. However, it would appear that Display Suite is only available for "Show: Content" and ...
0
votes
0answers
32 views

POST, with Guzzle, to a web service

I would like to POST a node to REST API on my Drupal site. On that site, I have enabled the following Web services modules: HAL HTTP Basic Authentication REST UI RESTful Web Services Serialization ...
0
votes
1answer
16 views

Cannot add a file with Search API Attachments

I'm using Search API with Solr and Tika under D8 to build a search engine on my website. I could not find any tutorial under D8 for that, so I followed one I've found on D7. However, when I try to ...
0
votes
0answers
11 views

Define permissions per resource

I'm using jsonapi for a headless approach, and need to return a 403 for certain resources if they don't have the permission to view them. Currently this isn't possible using the module - instead the ...
-3
votes
0answers
55 views

How can I create an alias or rewrite rule to a php file in a custom module

I created a custom module very similar to the core statistics module. I.e. I have a custom php file in my module located at /modules/custom/my_module/track.php. This works pretty nice, but I don't ...
0
votes
0answers
9 views

How can I changed the commerce tax display label?

Is there any way or method to change the displayed label for Tax in the cart in Drupal 8 Commerce 2? The carts ends up looking like this because I have city, county, and state sales tax. But I need ...
0
votes
0answers
45 views

Always load additional data from referenced (child) entity

I created some custom entity types, let's call them "parent_entity_type" and "historic_data_entity_type". The parent entity type is referencing to historic_data_entity_type indicating which data is ...
0
votes
0answers
23 views

How to specify a condition if the store is not store_pro?

I created a custom module. If the owner of the current store does not have the marchand_premium role, the add to cart button is overwritten. I want to add another condition : If the store is not ...
0
votes
1answer
34 views

How to customize a link with a custom module?

I installed the "Private Message" module on Drupal 8. There is a link to send a message that I want to transform into a Bootstrap button. How to customize a link on Drupal 8 ? Here is the HTML code ...
0
votes
0answers
22 views

Store per-user data in field and extract using SQL in Views sort plugin

TL;DR: This is less a question about how to write a Views sort plugin, and more whether I can serialise key/value pairs and selectively sort by one of them using SQL functions. I have a content type ...
0
votes
2answers
50 views

Increase weight range for child pages in book outlines (Book module)

When a child page is added to a book via "Add child page" (node/add/{content-type}), the Weight drop-down field in the Book Outline tab has a range of -/+ 15. This is due to line 191 in web/core/...
1
vote
1answer
51 views

Override field twig template in views

I am trying to override the field rendered in a view. The field name is: this_is_field I copied the /core/modules/views/views-view-field.html.twig and placed it my theme folder. I renamed with both ...
1
vote
0answers
59 views

How to theme the user login page [closed]

I am new to Drupal 8 and trying to design the user login page as per my requirements but not being able to do it. My problem is: I want to restructure the elements of the user login form (/user/login)...
-1
votes
0answers
28 views

How do I change the default value for a facet?

This has been answered for Drupal 7 on How to make one facet default? I would like to know how to change the default value for a facet in Drupal 8. Is there also a way to reorganize the facets which ...
1
vote
1answer
45 views

Flush cache in case of WSOD without Drush on shared host

I have installed Drupal from using build-in scripts on runcloud.io, but I have noticed that Drush is not available. They have replied: Sorry, it is not possible to install drush into Runcloud. ...
0
votes
1answer
24 views

Changing form field requirement via ajax

I have a selectbox field, that should change the disabled and required states of another field based on the value selected in the selectbox field. The change must be done via ajax. In my modules ...
0
votes
1answer
17 views

AJAX ReplaceCommand executes as expected only on first iteration

Expected Output: User triggers remove item button. Program updates database. Form gets rebuild with updated information from the database. AJAX replaces the old information with new information from ...
0
votes
2answers
34 views

Is it okay to expose .yml or .install files to public?

As per my knowledge the static files like css/js inside core/modules etc should be read by http server user. So normally I give read permission recursively to http user for directories like core, ...
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 ...