Still on Drupal 7? Security support for Drupal 7 ended on 5 January 2025. Please visit our Drupal 7 End of Life resources page to review all of your options.
I'm developing a module in Drupal 8 to create a custom content entity that pulls document information from an external MySQL database located on the same server. The idea is to define each document as an entity, pull data from each entity into views, use Search API to create a search index, and then use views to to view the search results. We have meta data for about 150,000 documents on our external database and we want to use Drupal as a search interface for those documents.
Running the default gulp task (or any other that creates the styleguides) is throwing several errors regarding the .twig files. Moreover it seems that in every include statement, eg.:
{% include "@THEME_NAME/components/messages/messages-icon-error.svg" %}
@THEME_NAME is set to /D which is incorrect and is in turn trying to access a file that does not exist.
I'm building a small custom module and I should somehow extend default user entity by adding about 20 more fields to it. I've read this (https://www.drupal.org/node/2629550) but it doesn't really explain how to "inherit" from some class.
I located User class definitions from Drupal folder (\drupal-8.1.8\core\modules\user\src\Entity\User.php). There I can see field definitions but that's not right place to do modification for sure :)
This is my first Drupal 8 site. I have a content type with a select list field. In my twig template I can print out the values. But I would like the keys too.
field_colors:
red_oak|Red Oak
white_oak|White Oak
.....
I can get the values easy...
{{ content.field_colors }}
But what I want to do in my twig template requires access to that key..
For Drupal 7 we were able to extract and have the code in a place like /var/www/drupal7/..... and then use "ln -s" to reference from the website document root most of the files and have own /sites/default... Thus updates in one place and multisites could not see files from another site because not in document root. Found someone had documented it here: https://www.drupal.org/docs/7/multisite-drupal/secure-multi-site-setup-u...