Showing posts with label Drupal 8. Show all posts
Showing posts with label Drupal 8. Show all posts

Wednesday, April 15, 2020

Drupal 8 Architecture Overview

What is Drupal?
Drupal is the most powerful CMS and open source in the market. It is built on top of PHP. Competitors are Joomla and Wordpress on open source. When it comes to paid resources on the content management systems, a couple of other high traffic CMS available in the market like Sitefinity, Sitecore, and Sharepoint.

There are few other advantages over drupal like vast community, open-source, serving a long period in the market and provided different solutions for respective domains. On community support get benefits out on the following areas on the development.

  • Documentation
  • Translations
  • Testing
  • Development including theming and contribution modules
  • Drupal community assembles the different experts in a common forum on drupal.org

How Drupal 8 different from Drupal 7?

Drupal 7 Drupal 8
It is built on top of core PHP It is built on top of Symfony Framework
Templates are built on PHP template files Templates are built on TWIG template files
There is no text editor is built in the Drupal core. CKEditor is present in Drupal core
The only limited field supports on Drupal core It has more extensible new filed support
Limited language support on Multilingual  It has many language support compare with drupal 7
Views are in drupal core It is in drupal core
There is web service support on Drupal core It has in-built support for web service creations
JS and CSS loading was not optimized respectively to the need Improved web page loading techniques















Drupal 8 Architecture Diagram



There is a huge transformation before Drupal 7 to Drupal 8. Drupal 7 is built on top of Core PHP with PHP Template files. Theming engine has improved in Drupal 8, It uses a new engine called TWIG. Overall Twig is the excellent add-on to Drupal 8, it improves the whole drupal ecosystem.

Symfony plays major roles in Drupal 8. The complete platform is built on top of Symfony framework.

Highlighted Features on Drupal 8

  1. Breakpoint Media Queries for Responsive Web Design
  2. Easy to install with hundreds of language support
  3. Better user experience for content update
  4. Preview for contents
  5. View in core
  6. Export entities as JSON / XML
  7. Inline editor 
  8. Layout Builder support (with Drag and Drop Features)
  9. Configurations are stored in files format (YAML)
  10. Better Template Engine (TWIG)
  11. Robust Framework as a base (Symfony)
  12. Enable by default for CSS and JS Aggregations
  13. HTML5 Supports
  14. Improved Entity caching
  15. Drupal Console is added advantage as CLI Tool.

Thursday, March 26, 2020

Drupal 8 Media Library with SVG upload

Uploading the media content and maintaining together with reusability was one of the challenges in earlier versions of drupal. Media Library has been included in the Drupal core. It has a better user experience including multiple media types that can be customized based on development requirements.

Media Library is a media management tool that enables you to find media that exists in your site and to add new media items. It allows you to search, sort, and create media items with a customizable interface. It can be used to add media items to an entity reference field or embed media into your content via a text editor.



To use the media library luxury, Throughout the site we should use the media field. It will help us to collect the media elements as a single point and will be provisioned for us to reuse using the media library.





Media type management will be maintaining the list of media types being supported by the media field. We can add the new media type through the user interface.

If you have appropriate permissions, this area allows you to add media items to the media library (it does not appear if you don't have permission).
By default media type has Audio, Document, Images, Remote video, and Video. In each type,
you can choose the source of files that can be accepted.
Adding SVG upload to Core Media Library
In the contribution community, there is a module called SVG Image field, that will help us to
enable the SVG to upload throughout the drupal content type.

Contribution module - https://www.drupal.org/project/svg_image_field
To enable the SVG format upload in the media library, we need to add a media type in structure.

To use the SVG upload in the content type, please follow the below steps

Add content type with media fields (To get the privilege of media library we should use
"Media" as field type)
Select a reference type as appropriate on next field configuration screen (I have opted for "image" and "SVG Image upload")


Monday, February 17, 2020

Drupal Content Workflow

In CMS world maintaining the content workflow is very important. When the content editor is
updating the content to the page, it always requires review and approval by the content manager.
This workflow will define the way, how the content will be published to the end-user on the site.

Drupal 8 has a core module to support content authorization workflow. But it doesn’t have the
ability to provide the interface to customize the own workflow depending on different organizations.
That will be achieved by contribution module called Workflow

This will help you establish the transition state between different content types and roles.
But the known disadvantage on this module, will not able to edit the
published content (Current published state content)



Tuesday, December 31, 2019

Drupal 8 aggregator workflow

Drupal aggregation has 2 different elements that are compressing the content on temporary files.
  1. JS
  2. CSS
Whenever we are enabling the aggregation in drupal. It will create a file in /sites/default/files/css 
and /sites/default/files/js folder with file contents. This file name will be stored in a cache table
called “cache_data”. If you delete any one of the files, it will keep on cache content and will try
to find the JS and CSS from this table.

If you opted for the drupal aggregation, make below steps are followed as drupal administrator
  1. Keep ready all JS and CSS files in the themes folder (themes/themesname/css and themes/themesname/js)
  2. Clear the cache (Configuration > Performance)
  3. Activate the aggregation in drupal CMS (Configuration > Performance)
After activated the above steps, you can find the compressed files on sites/default/files/css and
sites/default/files/js folder. 


Execute the below query in mysql DB, to find the list of aggregation entries are exists in the table


SELECT * FROM `cache_data` WHERE cid like 'css%' OR cid like 'js%'





In all terms of CMS we will have 2 views on systems. One is Site Administrator view (Drupal admin view)
and end user view (Public view)

Aggregation will be enabled in drupal admin section JS and CSS. It's up to the site
administrator option to enable both options or either one of them to be aggregated.
As soon as we opted for the aggregation in the drupal admin panel. On the next page load, it will start
picking up the JS / CSS from the public temp location of drupal, where we opted during the site setup.
This temp file will always be upto date, even if we have not opted for the aggregation.
When we opted for the aggregation, site JS / CSS will be on top of it.