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.
When creating a new content type, how can I add a field in D8 that is dependent/is a condition from another field?
If a user chooses from a selection, another field is shown with more selections (selections will be taxonomy terms)
Let me give an example:
Selection possibilities:
- Fruit
- Animal
On selection "Fruit", a new selection box is shown with following options:
- banana
- orange
- apple
When a user selects "Animal"
- bear
- monkey
- giraffe
I created a controller for my 404 page and the returned content works fine if I open the path of any 404 page.
But now, I want to redirect to an external URL instead, so my controller looks like this:
I've downloaded and formatted content from a tumblr site I run into some CSV files. After playing with Drupal 8 for a few days, it seems like an excellent migration target. Except... I can't figure out how to import my content!
Hello,
I have started developing modules for Drupal 8 and can't find how to get database tables to be created on install.
I looked at the documentation that said I should use the .install-file and hook_schema() as in Drupal 7. This, however, seems not to work. In fact, the install file seems to be ignored completely.
Can anyone tell me where to place the code for database table creation, and in what format it should be?
I have a taxonomy field for "County" on the Article Content Type and also on User Profiles for the user to select during self registration. I want to send an email to users when new articles are added matching their County.
How do get the list of (and loop through) the user emails matching the county in the article?
Should I be using entity_insert(for node save) along with _mail(for the email template)?