Cómo Sobrevivir a Drupal 8

David Flores

Co-Mantainer at @DrupalConsole, Linux, Drupal, Symfony, Silex, BackEnd, Seguridad, Python, Open Source, Father ...sometimes #Nerd Speaker

david@indava.com

@dmouse

Site Builders
Themers
Developers

Site Builders

Content Type  Taxonomy

Menu  Blocks Views Display

Mode Modules Cron

Drush Node Permission Users

The Same Glossary

Improvements

Blocks

Comments

Tour

CMI

CMI

<?php

...
    $site = $this->config('system.site');
    $site->set('name', 'Indava IT')
    ->save();
...

Translation

Everything is translatable

REST API

REST API

REST API

Themers

Libraries

Libraries


maintenance_page:
  version: VERSION
  css:
    theme:
      css/maintenance-page.css: {}
  dependencies:
    - system/maintenance
    - bartik/global-styling

Breakpoints

TWIG

Learn Twig




{# Twig Template #}                    {# Comment #}

<ul>

    {% for item in items %}            {# Logic #}

        <li> {{ item.name }} </li>     {# Print #}

    {% endfor %}

</ul>

Learn Twig



{{ comment | raw }} {# Filter #}
        
        
{% block sidebar %}
    
    <h3>Table Of Contents</h3>
    
    {{ parent() }} {# Function #}
    
{% endblock %}

Crazy For's



{% for item in items if item.price > 50 and item < 100 %}

    {{ item.name }}

{% else %}

    Item not found.

{% endfor %}

Real Debug

<div id="block-bartik-page-title" class="...">
  
    <div class="contextual" role="form">....</div>
      <div class="content">
      

    <!-- THEME DEBUG -->
    <!-- THEME HOOK: 'page_title' -->
    <!-- BEGIN OUTPUT from 'core/themes/bartik/templates/page-title.html.twig' -->

    <h1 class="title page-title">Welcome to D8</h1>


    <!-- END OUTPUT from 'core/themes/bartik/templates/page-title.html.twig' -->

    </div>
  </div>

Twig Videos

  • https://www.youtube.com/watch?v=1m6WR7e7qwU
  • https://vimeo.com/80663253
  • https://vimeo.com/26149946

Developers

Glossary

OOP  Namespace

Composer 

PHP-5.5   Controller   Service

Twig   PSR*  CMI

Console  Plugins  YML  Annotations

http://drupalconsole.com

Drupal Console

dmouse [at] drupal8.dev [8.0.x] > console route:debug system.site_maintenance_mode
 Route name                   Options                                    
 system.site_maintenance_mode                                            
  + Pattern                   /admin/config/development/maintenance      
  + Defaults                                                             
   - _form                    Drupal\system\Form\SiteMaintenanceModeForm 
   - _title                   Maintenance mode                           
  + Options                                                              
   - compiler_class           \Drupal\Core\Routing\RouteCompiler         
   - _admin_route             1                                          
   - 0                        content_type_header_matcher                
   - 0                        route_enhancer.param_conversion            
   - 0                        access_check.permission 

Drupal Console

dmouse [at] drupal8.dev [8.0.x] > php console.phar container:debug
 Service ID                                    Class Name                                                                        
 class_loader                                  Composer\Autoload\ClassLoader                                                     
 kernel                                        Drupal\Core\DrupalKernel                                                          
 service_container                             Drupal\Core\DependencyInjection\Container                                         
 cache_context.ip                              Drupal\Core\Cache\Context\IpCacheContext                                          
 cache_context.headers                         Drupal\Core\Cache\Context\HeadersCacheContext                                     
 cache_context.cookies                         Drupal\Core\Cache\Context\CookiesCacheContext
...

$ vim core/lib/Drupal/Core/DrupalKernel.php

console --learning

Videos

  • https://www.youtube.com/watch?v=E3FQZ285XVE
  • https://www.youtube.com/watch?v=8Eu43RXKHmw
  • https://www.youtube.com/watch?v=qMiCS20CWxU

David Flores

Co-Mantainer at @DrupalConsole, Linux, Drupal, Symfony, Silex, BackEnd, Seguridad, Python, Open Source, Father ...sometimes #Nerd Speaker

david@indava.com

@dmouse

Made with Slides.com