D8: Dependent/conditional fields in node content type creation.

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 would create the selection terms with taxonomy.

TrustedRedirectResponse redirecting to front page instead of external URL

Hi all,

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:

"Select list" options from database

Hi !

I create a dropdown list (select) but with static options, i'm trying to have dynamic options but it's not working

  $form['select'] = [
        '#type' => 'select',
        '#title' => t('Choisissez le groupe à afficher : '),
        '#options' =>  [
            '0'=> t('blabla'),
            '1003' => t('bla'),
...
]

As you can see I'm trying to associat a value to a name, so i did 2 request :

Drupal migration: CSV Import Assistance

Good evening,

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!

I've attempted to follow the examples here:
- https://www.drupal.org/node/2574707
- https://github.com/heddn/d8_custom_migrate

But I'm hitting a brick wall.

Drupal 8, create tables on module install

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?

Looping through Users that match Taxonomy Based Field

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)?

Any help would be appreciated! :)

Pages

Subscribe with RSS Subscribe to RSS - Drupal 8.x