Skip to main content
Search type Search syntax
Tags [tag]
Exact "words here"
Author user:1234
user:me (yours)
Score score:3 (3+)
score:0 (none)
Answers answers:3 (3+)
answers:0 (none)
isaccepted:yes
hasaccepted:no
inquestion:1234
Views views:250
Code code:"if (foo != bar)"
Sections title:apples
body:"apples oranges"
URL url:"*.example.com"
Saves in:saves
Status closed:yes
duplicate:no
migrated:no
wiki:no
Types is:question
is:answer
Exclude -[tag]
-apples
For more details on advanced search visit our help page
Results tagged with
Search options not deleted user 41346

Version tags should be used for questions that apply to a version only, not to merely say what version a site is using.

0 votes
1 answer
92 views

How to match a Drupal path in Apache config [closed]

My D8 site uses the usual convention in .htaccess to rewrite non-file requests to index.php: RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_URI} !=/favi …
Mike Godin's user avatar
1 vote

How to match a Drupal path in Apache config

The directive I was trying to insert was Require all granted. I managed to achieve the same effect by proxy-passing requests for /foo/bar to another virtual host running on the same machine, but unre …
Mike Godin's user avatar
4 votes
2 answers
2k views

Programmatic access to metatag module fields

I am wondering how to programmatically access metatag module data. For example, my node has an entry for metatag description, and I see in the generated page the meta description tag, which is great. …
Mike Godin's user avatar
1 vote

Get the list of all content types

Provided in case node_type_get_names() gets deprecated in the future (also a nice example of array_map usage): function node_type_get_names() { return array_map(function ($bundle_info) { return …
Mike Godin's user avatar
0 votes

How do I access paragraphs with the JSON API?

None of the answers seem to address the question of more deeply nested paragraphs. As long as the depth of nesting is well defined, the ?include= parameter can be used to obtain such paragraphs. For e …
Mike Godin's user avatar
2 votes
0 answers
159 views

Dealing with installed modules/extensions in composer packages removed from composer.json [duplicate]

I had brought up a similar question on StackOverflow, but it hasn't gotten much traction because of a lack of understanding of Drupal, I think. The issue we are experiencing happens when a developer …
Mike Godin's user avatar
0 votes

Development with git branches/ gitflow and new modules

Working with a very large database, it is not always practical to run drush sql-cli < live.sql Ideally, composer install would be run with an option to disable module uninstalls, followed by drush c …
Mike Godin's user avatar
1 vote

How can you completely remove an old deleted field?

The only way I could resolve this was to create the missing table, for example: CREATE TABLE `field_deleted_data_XXX` ( `bundle` varchar(128) CHARACTER SET ascii NOT NULL DEFAULT '', `deleted` tin …
Mike Godin's user avatar
0 votes

How to determine if view has translations and which ones

I have been fighting with this lately, and can answer part of the question. If you have the $viewId and $displayId, then the following seems to indicate whether a translation of the view label, title …
Mike Godin's user avatar
3 votes
1 answer
227 views

How to add highlighting to exposed views_autocomplete_filter in Drupal 8

Is there a way (a hook perhaps) that would allow me to modify the autocomplete fields returned by an exposed views_autocomplete_filter field? I'd like to style the text typed into the field different …
Mike Godin's user avatar
2 votes

How to add highlighting to exposed views_autocomplete_filter in Drupal 8

So it seems it is necessary to extend the ViewsAutocompleteFiltersController class to do this. In order to override the routing so that a custom controller can be used instead, an entry must be added …
Mike Godin's user avatar
1 vote
1 answer
537 views

How to change image style using hook_views_pre_render()

I am trying to adapt the following Drupal 7 code to Drupal 8, in order to set a different image style to every image in a view: // Assigns a random style name to each image function <MODULE_NAME>_views_pre_render …
Mike Godin's user avatar
2 votes

How to change image style using hook_views_pre_render()

I gave up on hook_views_pre_render and wound up meeting my requirements with template_preprocess_image_formatter as follows: function <TEMPLATE_NAME>_preprocess_image_formatter(&$variables) { $styl …
Mike Godin's user avatar