Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Szépségszalon a Vertikális Végtelenhez – Drupal 8 sminkelés

Tamás Hajas
November 15, 2014

Szépségszalon a Vertikális Végtelenhez – Drupal 8 sminkelés

Drupal Hétvége 2014 előadásom diái
http://drupal.hu/konferencia/2014/program#d8smink

Tamás Hajas

November 15, 2014
Tweet

More Decks by Tamás Hajas

Other Decks in Technology

Transcript

  1. kulcs_neve: érték kettőspont ':' (nem egyenlőségjel) # komment: kettőskereszt '#'

    (nem pontossvessző) struktúra: behúzással jelezve Change record: https://drupal.org/node/1935708 YAML szintaktika
  2. ! description: Ez egy bitang jó smink! :) version: 1.0

    ! ! ! ! package: custom screenshot: bitangjo.png Creating a D8 sub-theme: https://drupal.org/node/2165673 type: theme name: Bitangjó smink ! ! core: 8.x base theme: classy # engine: twig bitangjo.info.yml
  3. # Stíluslap felülbírálása ! ! # Stíluslap „etávolítása” Change record:

    https://drupal.org/node/1876600 stylesheets-override: - normalize.css ! ! stylesheets-remove: - jquery.ui.dialog.css bitangjo.info.yml
  4. • Base • Layout • Module • State • Theme

    SMACSS-szerű CSS fájl-struktúra
  5. • Base • Layout • Component Module • State •

    Theme SMACSS-szerű CSS fájl-struktúra
  6. • Base • Layout • Component Module • State •

    Theme SMACSS-szerű CSS fájl-struktúra
  7. base • elements.css • typography.css layout • layout.css • node-add.css

    • … components • buttons.css • buttons.theme.css • … theme • install-page.css • appearance-
 page.css SMACSS-szerű CSS fájl-struktúra (smink) Forrás: seven theme
  8. • module_name.module.css 
 (layout, component, state) • module_name.theme.css • module_name.admin.css

    
 (layout, component, state) • module_name.admin.theme.css • module_name.base.css SMACSS-szerű CSS fájl-struktúra (modul)
  9. <div class="flower__bed"> <div class="flower flower--tulip is-pollinating"> <div class="flower__petals"> <div class="flower__face"></div>

    </div> <div class="flower__stem"> <div class="flower__leaves"></div> </div> </div> </div> John Albin: Managing complex projects with design components BEM
  10. # Smink régiók Forrás: seven.info.yml regions: content: Content help: Help

    page_top: 'Page top' page_bottom: 'Page bottom' sidebar_first: 'First sidebar' regions_hidden: - sidebar_first bitangjo.info.yml
  11. base: version: 1.x js: js/bitangjo.js: {} dependencies: - core/drupal -

    core/jquery - core/jquery.once Forrás: https://github.com/sqndr/d8-theming-guide bitangjo.libraries.yml
  12. bartik.mobile: label: mobile mediaQuery: '(min-width: 0px)' weight: 0 multipliers: -

    1x bartik.narrow: label: narrow mediaQuery: 'all and (min-width: 560px) 
 and (max-width: 850px)' weight: 1 multipliers: - 1x bartik.wide: label: wide mediaQuery: 'all and (min-width: 851px)' weight: 2 multipliers: - 1x bartik.breakpoints.yml
  13. Breakpoints » Responsive images • Responsive images modul • Mapping

    beállítása • Breakpoint group • Breakpoint – Image style
  14. Breakpoints » Responsive images • Responsive images modul • Mapping

    beállítása • Breakpoint group • Breakpoint – Image style • RI image formatter • Mapping választása
  15. • Képstílus létrehozása (admin felület)
 /admin/config/media/image-styles/add • Képstílus exportja admin

    felületről
 /admin/config/development/ configuration/single/export • Exportált YAML a sminkbe
 bitangjo/config/install/ image.style.style_name.yml Képstílusok a sminkben
  16. uuid: 311e7c58-c64a-4c9e-b544-68b12b560e36 langcode: en status: true dependencies: { } name:

    thumbnail label: 'Thumbnail (100×100)' effects: 1cfec298-8620-4749-b100-ccb6c4500779: uuid: 1cfec298-8620-4749-b100-ccb6c4500779 id: image_scale weight: 0 data: width: 100 height: 100 upscale: false third_party_settings: { } image.style.thumbnail.yml
  17. Twig coding standards: https://drupal.org/node/1823416 *.html.twig fordítás {% trans %} Submitted

    by {{ author_name|passthrough }} on {{ date|passthrough }} {% endtrans %}
  18. Twig coding standards: https://drupal.org/node/1823416 *.html.twig if funkció {% if site_slogan

    %} <div class="site-slogan"> {{ site_slogan }} </div> {% endif %}
  19. Twig coding standards: https://drupal.org/node/1823416 *.html.twig for loop <ul> {% for

    user in users %} <li> {{ user.username }} </li> {% endfor %} </ul>
  20. Twig coding standards: https://drupal.org/node/1823416 *.html.twig Twig változó definiálása {% set

    classes = [ 'admin-list', compact ? 'compact', ] %} ! … ! <ul{{ attributes.addClass(classes) }}>
  21. Twig debug $ cp example.settings.local.php 
 default/settings.local.php if (file_exists(__DIR__ .

    '/settings.local.php')) { include __DIR__ . '/settings.local.php'; } …és a settings.php-ben:
  22. Change record-ok: https://www.drupal.org/node/2352319, https://drupal.org/node/2169605 bitangjo.theme /** * Implements hook_form_FORM_ID_alter(). */

    function bitangjo_form_recipe_alter(&$form, &$form_state) { ! // Use Picker to replace default checkboxes and radios. $form['#attached']['library'][] = 'bitangjo/picker'; }
  23. ! ‑ Böngésző Weboldal megjelnítése Headless Drupal Adatbázis ‑ PHP


    „adatszolgáltatás”
 ! ⬍ JS
 adatfeldolgozás, HTML render
  24. • https://drupal.org/theme-guide/8 • Change records (theme): http://j.mp/1qFSKXq • http://d8.sqndr.com •

    https://amsterdam2014.drupal.org/session/twig- and-new-drupal-8-theme-system • Twig Coding Standards: https://drupal.org/node/ 1823416 • CSS CS: https://drupal.org/node/1886770 • JS CS: https://drupal.org/node/172169 további infók