36
Thoughts about Certification Exams: Drupal 8 Site Builder & Drupal 8 Developer Thoughts about Certification Exams: Drupal 8 Site Builder & Drupal 8 Developer Gung Wang Senior Web Developer OPIN Software Inc. Cornell DrupalCamp V, Oct. 12, 2018 Cornell DrupalCamp V, Oct. 12, 2018

Thoughts about Certification Exams: Drupal 8 Site …...Thoughts about Certification Exams: Drupal 8 Site Builder & Drupal 8 Developer Gung Wang Senior Web Developer OPIN Software

  • Upload
    others

  • View
    30

  • Download
    0

Embed Size (px)

Citation preview

Thoughts about Certification Exams:

Drupal 8 Site Builder & Drupal 8 Developer

Thoughts about Certification Exams:

Drupal 8 Site Builder & Drupal 8 Developer

Gung Wang

Senior Web Developer

OPIN Software Inc.

Cornell DrupalCamp V, Oct. 12, 2018Cornell DrupalCamp V, Oct. 12, 2018

About Myself

● 8 Years Drupal Experiences since 2010

● Drupal 6, 7 and 8

● Master Degree in Computer Sciences

● Working for OPIN Software for Enterprise Drupal

● Acquia Certified Site Builder - Drupal 8

● Acquia Certified Developer - Drupal 8

Do I Have To Take These Exams?

● Is it worth taking the exam?➔ $155 for site builder exam, $250 for developer exam,

$300 for front end specialist, $350 for back end specialist.➔ Time: my PD time and my weekends➔ As a drupal site builder or developer: absolutely YES➔ As a boss: recommended programs of professional development

● Why shall I take these exams?➔ Huge differences between D8 and D7 ➔ Professional in D7 !== in D8

● Many colleges failed at 1st time even though they are professional in D7

➔ Refresh and upgrade my knowledge and skills

Site Builder & Developer Exam

● How to prepare for Site Builder Exam?➔ NOT require any knowledge of programming(PHP) or theming(JS, Twig, CSS).

➔ NOT require any knowledge of contributed modules.

➔ Covers how to build & administer a website through Admin UI in D8.

➔ NOT require D7; Master D8 core, every core module, every piece of configuration.

● How to prepare for Developer Exam?➔ NO question about any simple admin functionality.

➔ D7 knowledge is helpful, but not too much.

➔ Focus on new features of D8: entity, annotation discovery, entity references etc.

➔ Dig into core source code and build modules to resolve real world issues.

Site Builder: Blocks and Menus

● Blocks and Custom Blocks➔ Study this hard. I got many questions related.

➔ How to place block, configure block, blocks VS block types.

➔ Understand and try every option of block.

➔ Configure entity, one block placed in multiple region.

● Menus➔ Menu an menu items: menu in block.

➔ Translation of menu items.

Content Entity, Configuration Entity

● Content Entity➔ What things are content entity in D8?

➔ Article, Page, Book, User, Comment, Views, Taxonomy, Menu, Block?

➔ What is difference between content type and bundle?

● Configuration Entity➔ What things are Configuration Entity in D8?

➔ Block, Views, Taxonomy? Bundles?

● Content Type➔ How to manage fields on a content type?

➔ Understand all field types that come with Core, and how they work.

Taxonomy and Views

● How to use Taxonomy (Vocabulary and Terms)?➔ How to organize contents in hierarchy structure with Taxonomy?

➔ How to link/reference a vocabulary to a content type?

➔ When do you create a new vocabulary vs. When do you create a new content type?

➔ How to use taxonomy in a View with Relationship and Contextual filters?

● Views: Study this hard. I got many questions?➔ How to create views for block, page, RSS?

➔ How does Drupal core use Views for administration? Many admin Views.

➔ How to set up Cache for view?

➔ How to use Advanced filter and contextual filters?

Display Modes

● View modes are NOT VIEWS?➔ admin/structure/display-modes : Provide different presentations of Content

Entities for either viewing or editing.

➔ How to use different view modes for the same content type in a View (Views).

● What are Form modes?➔ A way to create different field configurations with the same content entity

bundle. Form modes allow for multiple sets of field widget orderings and customizations.

➔ Two tabs: "Manage fields" and "Manage form display."

Comments, Contact Forms, Extensions

● What the special feature of Comments in D8?➔ How to attache comment to an entity (content type)?

➔ How comment approval works

➔ How to use comment type?

● How to use the new Contact Forms system?➔ What is relationship between contact form and entity?

● How to install modules and themes?

User, Role, Permission

● How to resolve a real issue by using user, role, and permission?➔ How to add custom fields to users?

➔ How to create/cancel user account? How to add role to user?

● Why an editor (authenticated user) can’t change a page?

● How to set up a View (Views) permission (access control)?

● What the best solution of access control for Manager, Publisher, Content Editor, Client?

Configuration Synchronization & Content Types

● How to Create 2 websites, one is DEV and another is PROD.

● How to export configuration, full site export and single item export?

● How to import configuration from a copy of site to another?Full site import and single item import.

● How to fix the conflicts after import?

● How to create custom content type: add fields image, comments, entity reference, taxonomy term, etc.?

● What happens if a term is deleted which is referenced by the Custom content type?

● What happens if a node is unpublished which is reference by another?

Multilingual & Performance

● Go a few questions. Worth to spend time on it because it is NEW.➔ When to setup the 2nd language for current site, the language package can’t be

downloaded automatically. How to fix it?

➔ How to translate the standard user interface

➔ How to translate the configuration (custom fields and content types, etc)?

➔ How to translate a menu item created by a Views?

● How the Drupal cache system works? ➔ Which modules do what, and which user role is affected by the different caches?

➔ What are Static Cache and Dynamic Cache?

➔ Check out the development options available like Various caching options.

Text Format & Aggregator & Development

● What are Filters and how to use?➔ When would you need them?

➔ How do they help in the securing the site?

● What is aggregator and what is for?➔ How to configure it to pull some feeds into the website?

● What do these options of Devel mean ?➔ How to check logs on the Status Report page?

➔ Controlling display of various type of errors and notices displayed on the site.

Drupal Community & Recommendation

● How to get involved in the Drupal community?➔ How to properly interact with module and theme maintainers?

➔ How to report a bug of module?

➔ I got 2 questions: easy-score questions.

● Highly recommend for the beginner of D8:➔ Drupal 8 Beginner Tutorials - the BEST Drupal videos :

➔ https://www.youtube.com/playlist?list=PLtaXuX0nEZk9MKY_ClWcPkGtOEGyLTyCO

● Highly recommend for preparing the Site Builder Exam:➔ The Drupal 8 Site Building Class

➔ https://www.youtube.com/playlist?list=PLtaXuX0nEZk9_p3OiVFV96FMQwPWklRiL

NO Questions Like These:

● How to create/edit/delete a page/article?

● How to configure the site information?.

● How to create custom content type?

● How to add/edit user/role?

● How to create a Views?

● How to create a vocabulary and terms?

● How to install/uninstall modules or themes

● How to create a block or place a block?

Acquia Certified Developer – Drupal 8Acquia Certified Developer – Drupal 8

Design, develop and deploy D8 solution.

Understand the core D8 basic architecture.

Develop and maintain applications using D8 front and back end development.

Develop and implement new D8 modules and themes.

Fundamental Web Development Concepts

● HTML/CSS➔ HTML Tags: article, aside, details, figure, header, main, nav, section, etc.

➔ CSS Selector: id=100, class_name=10, tag=1#my_first .sticky <li> = 111 V.S. #second #internal-page = 200

➔ !important: overrides any other declarations.

➔ CSS Combinators: A, B | A B | A>B | A + B | A ~ B

● Javascript/jQuery➔ Adding Javascript Libraries & attaching JS in 3 ways

● my_theme.info.yml● function **_process_node()

{ $variables['#attached']['library'][] = 'my_theme/conplaints-triggers'; }● twig template:

{{ attach_library('my_theme/conplaints-triggers') }}

➔ Understanding ‘strict mode’ & most important jQuery functions.

Code

Site building

● Go back the Site Builder section for more details.

● Some points I feel important:➔ What is the difference between Content Entity and Configuration Entity?

➔ What is Field Type & how to use Fields Types (Comments, Date, Email, Link, etc.)?

➔ How to use Contextual filter of Views, Relationship of Views?

➔ What is RESTful service in D8?

➔ How to GET, POST, PATCH, DELETE a node? PHP, JS, CURL?

Front-end Development (Theming)

● How to create a theme and a sub theme?➔ What is the difference between stable and classy?

➔ How and where to use breakpoint module?

➔ See a example of next page.

● How to use variable, filter & function in twig?➔ Arrays & objects; Setting variable; Conditional; Looping; Commenting;

➔ Filter; Macros ???

➔ See a example of next page.

● How to override Twig templates?➔ Twig Debug Mode: default/services.yml => {{ dump(foo) }}

➔ How to use Theme Hook Suggestions?function substable_theme_suggestions_block_alter

➔ How to include/extend twig template?

Back-end development (coding)

It will be very boring.It will be very boring.

Object-oriented programming

● OOP File Structure?➔ Choose the correct answer about extends and implements.

➔ What is the Factory pattern and how to use? (which block of code is correct?)

● PHP Namespaces➔ \Drupal\myMod1\Controller\ModuleController::getDesc()

➔ \Drupal\myMod2\Controller\ModuleController::getDesc()

Custom Modules

Data Storage and database API

● How and When to use PDO?➔ What are differences between Static Query and Dynamic query?

query() method of a connection objectdb_query() function

➔ in 90% of select query use cases you will have a static query. If in a critical performance path, you should use query() instead of select() for performance reasons.

● Example of Dynamic query:

Block API

● What is Annotation?➔ AnnotatedClassDiscovery

➔ How to use annotation to define a Block?

➔ How and when to Block Plugin API or Block Entity API?

➔ How to create a custom block in a custom module?.

● Plugin system in D8?

➔ small pieces of functionality that are swappable.

➔ 'Field widget', ‘Block’,

Entity API

● Understanding the fundamental building blocks of the D8?➔ Configuration entities: Used by the Configuration System.

Supports translations and can provide custom defaults for installations.

➔ Content entities: Consist of configurable and base fields, can have revisions and support translations.

➔ Bundles, entity’s sub types.

➔ See a Content Entity code on the next slide.

● Working with Entity API

➔ if ($object instanceof \Drupal\Core\Entity\EntityInterface)

➔ $entity→getEntityTypeId(); $entity→access('view');

➔ $entity->uri(); $entity→save(); $node->save();

➔ $node = entity_create('node', array( 'title' => 'My node','body' => 'The body content.'));

Form API

● If knowing D7 Form API, it is easy to learn in D8➔ Implementing the \Drupal\Core\Form\FormInterface

➔ ConfigFormBase - For creating system configuration forms like the one found at admin/config/system/site-information.

➔ ConfirmFormBase - For providing users with a form to confirm an action such as deleting a piece of content.

➔ FormBase - The most generic base class for generating forms.

● Form Field Types:➔ Check D8 Form document for all.

● Functions in Form class:

➔ GetFormId(); buildForm(); validateForm(); submitForm();

➔ Form Routing

➔ $form = \Drupal::formBuilder()->getForm('Drupal\mymodule\Form\ExampleForm', '127');

Services and Dependency Injection

● What is the Service and How to create a Service?➔ services pluggable and replaceable by registering them with a service container.

➔ perform operations like accessing the database or sending an email.

➔ path.alias_manager: class: Drupal\Core\Path\AliasManager arguments: ['@path.alias_storage', '…']

➔ class AliasManager implements AliasManagerInterface, CacheDecoratorInterface public function __construct( AliasStorageInterface $storage,

AliasWhitelistInterface $whitelist, LanguageManagerInterface $language_manager, CacheBackendInterface $cache) { }

● Dependency Injection in __costruct above:➔ Dependency injection is the preferred method for accessing and using services in

Drupal 8 and should be used whenever possible.

➔ Services are instead passed as arguments to a constructor or injected via setter methods.

Events

● Dispatching Events

● Subscribing to Events

● I didn’t get questions on it.

Other API I feel important

● Menu API➔ menu links; Local tasks; Local actions.

● Logging API➔ Logging a notice; Severity Levels; Shorthand functions;

● Routing System➔ Yml file

Coding Standards & Performance

● I got one question to select errors (not standard) in a block of code.

● Performance ➔ I got one question about Caching in the code: Inside Render Arrays

➔ Core Performance Modules

Security

● I didn’t get a security related to the coding.

● It is one of most important things for a website:➔ How D8 make the website more secure?

● Sanitizing Input➔ Using Twig Autoescape

➔ API functions: Html::escape(); UrlHelper::stripDangerousProtocols($uri); ect.

➔ Database Abstraction (Query injection)

➔ File Permissions

➔ Secure Configuration (site builder) : user registration, Role permissions, etc.

➔ Secure user with uid=1

➔ Writing secure code for Drupal 8

➔ Keeping your site up-to-date

Resources for D8 Developer

Part I: Learning Drupal

Part II: Drupal 8 Development Cookbook

Part III: Drupal 8 Theming with Twig

Thank You So Much !

Any Questions?

Thank You So Much !

Any Questions?

Email me: [email protected]

Cornell DrupalCamp V, Oct. 12, 2018Cornell DrupalCamp V, Oct. 12, 2018