Search Results
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 |
Version tags should be used for questions that apply to a version only, not to merely say what version a site is using.
1
vote
Accepted
How do I detect whether any contact forms have been created?
You can use the D8 config factory interface to retrieve multiple contact form config keys and their corresponding config entities:
$contact_form_keys = \Drupal::configFactory()->listAll('contact.form' …
4
votes
Accepted
How do I use the flood interface?
They are two different parameters that share the same name (and can share the same value by default). Per the docs for FloodInterface:
::register():
int $window: (optional) Number of seconds befor …
4
votes
Accepted
How do you add type-property schemas from Schema.org into 8 sites?
In Drupal 8, the project has deferred to the RDFUI project, to provide the UI component, now that other parts of the module have been ported to core. … The default RDF mappings of Drupal core have been updated to include
schema.org in Drupal 8. Also, a lot of the backend code of this module
was ported into Drupal 8 core. …
7
votes
Accepted
How can I get the active menu trail for the current page?
MenuLinkTreeInterface::getCurrentRouteMenuTreeParameters() is what you want. To use the example above:
$menu_tree = Drupal::menuTree();
$parameters = $menu_tree->getCurrentRouteMenuTreeParameters('ma …
0
votes
Accepted
Including a large amount of raw data with a module
Your intuition is correct; you should break out your large dataset into some include file. I don't believe there's a strict mention of large datasets in the Drupal coding standards, but isolating out …
8
votes
Accepted
How do I use Path Matcher for front page?
Your code is assuming that the request URI for / will retrieve /node on the getAliasByPath() method call. It won't. Setting the Drupal front page isn't the same as setting a path alias in the Path mod …
1
vote
How to Query MySQL Database Module
$connection doesn't exist in the context of hello(). You need to use $this->connection if you're wanting to use the Connection that's built in your object.
1
vote
How to remove undesired local task tabs
Your $access variable is overwritten with the original Node Clone logic that looks at whether the user has the permission. Hence, it will never return an AccessResultForbidden object on the faq conten …
0
votes
How to get route name YAML Block/Form?
Drupal routes aren't display in a UI anywhere, but you can look them up in a database client (e.g. PHPMyAdmin). The route defnitions are stored in the router table. The name, path, & pattern_outline c …
4
votes
Create / Edit node and continue editing on same page after submit
The Save & Edit module is a very basic module. It comprises of 6 total functions, so a port could be done less than a day.
Alternatively, if the your requirement is to just save editing progress whi …
1
vote
Reference Live Files with Built-In Server
So drupal server is a Drupal Console wrapper around Symphony's
server:start & PHP's built in web server. As you can see in the Symphony (& PHP) docs, you can configure a router script for the server …
0
votes
Access User Data from external script inside a custom module
The code snippet is bootstrapping Drupal by assuming it's in Drupal's root path (i.e. require_once 'autoload.php';) To have it runnable from the module dir, you'll have to alter the relative path to m …
0
votes
Default front page not showing https
Yes. The field prefix is populated by the RequestContext:: getCompleteBaseUrl() method, the underlying property, completeBaseUrl, is assigned from $GLOBALS['base_url'] if it's set.
You'll have to te …
0
votes
Can a Drupal Site Administrator view contents of settings.php or some other file in file sys...
For brevity, it helps to think about this question in terms of roles/permissions (since "site admin" is an overloaded term):
Does the ____ role have an escalated permission to:
Write arbitrary fil …
1
vote
Accepted
How to set time limit only for one php file?
You can find many examples of creating a queue and a queue worker by searching Google for [drupal 8 queue api]. …