Search Results
… and clear the caches the main menu will contain a new link. Creating A Category Menu Let's do something more useful with this menu deriver … file to look at a different deriver class. my_module.category.links: deriver: '\Drupal\my_module\Plugin\Derivative\CategoryMenuLinkDeriver' class: '\Drupal\Core\Menu\MenuLinkDefault' The …
… stores the taxonomy terms for an article. $fieldName = 'field_article_category'; /** @var \Drupal\field\Entity\FieldStorageConfig … method would be called like this, with a field called field_article_category on the article content type. $options = $this->getOptionsFromField('field_article_category', 'node', 'article', $account); The options list we create …
… Set the filter to provide a default value of the content ID from the URL. This will automatically pass the current page to the contextual …
Article: Drupal 8: Automated Spam Protection
… Spam is a constant problem for any site on the internet that has a publicly available form, but automatically preventing … real content being submitted by real users. Manually moderating blog comments is usually a good idea, but many websites contain contact …
… an item of content. Whilst the internal path of a page might be "/node/1" the external path can be anything you want, and can be set when … points to the basic path of the content entity, which would be "/node/1" for all content type entities. Outside of the Path Auto module there … parameter is the value from the path being loaded, so a path of "/node/1" would set the $value to be "1", which we would then use to load the …
Article: Drupal 7 Audit SQL Queries
When doing site audits on Drupal sites it’s always a good idea to get a feel of what sort of content types, users and taxonomy terms are available. Here are some SQL queries that I tend to use when starting out on a Drupal Audit. User/Roles Breakdown SELECT role.name as Role, COUNT(role.name) as …
… = @Translation("Creates a block with a lazy builder button."), * category = "custom", * context_definitions = { * "current_user" = …
A recent Wired article about the Parler data hack talked about how a hacker group was able to steal publicly available information from the Parler website using an Insecure Direct Object Reference (IDOR) or enumeration attack. This type of attack involves a hacker looking at the structure of the …