Using jQuery.AJAX() to Retrieve Sample JSON Data

Traditionally the X in AJAX has usually equated XML (eXtensive Markup Notation). In recent years, JSON (JavaScript Object Notation) has taken over in many cases due to its overall efficiency and ease of use. In general, JSON is a much less verbose syntax, which has gained a lot of popularity in modern JavaScript frameworks. Part of this popularity can be attributed to the fact that JSON data can be parsed quicker and because it’s less verbose, less bandwidth is needed to transmit it back and forth. In this overview we will look at how easy it is to get up and running consuming JSON data using the popular jQuery library. ...

October 10, 2016 · 5 min · 865 words · icarnaghan

Analyzing Nginx and Apache access log and error log files

A log file generated by a web/database server is one of the most important files. It contains useful information on visitors, errors, warnings, etc. Some people think log files as server resource killer. Hence, they disable them in Apache, DB or NGINX configuration file. One more reason why people disable or ignore server logs is because the content of logs is difficult to understand. Hence, most noob webmasters use a log file analyzer program to check server logs. ...

September 6, 2016 · 3 min · 483 words · prhost78

Best Atom packages for web development (2018)

The black background of the text editor soothes my eyes. The text color is great and the interface of the Atom editor is awesome. If you don’t like the default Look and Feels, you are free to change it as per your preference or download a new Atom theme. My favorite color is black so I don’t find it necessary to change the theme. The atom editor gets updates on a regular basis. Since I’ve started using the editor, GitHub has rolled out many updates. Each update makes the editor better. I’m interested only in code. Hence, I haven’t checked the full features of Atom editor. For me, Atom is the best tool for web development. ...

September 1, 2016 · 3 min · 559 words · prhost78

Preparing for the Acquia Certified Developer Exam Drupal 8

The Acquia Certified Developer exam Drupal 8 just launched a couple of months ago. I was interested in studying for this exam as I have been working in Drupal 8 for the last six months and future projects look most likely to be Drupal 8 based. I had looked at the various Acquia certification tracks in the past, however I was never fully committed to the Drupal 7 track so I was happy when Acquia announced first the Foundations and then later the Certified Developer exams. I took the Foundations exam first and found that while I was weaker in my front-end Drupal 8 skills, I managed to pass. Later when I sat for the Certified Developer exam I realized there was a bit of cross over in terms of the questions, in fact I think a few of them were taken directly from the foundations exam. I would recommend anyone considering the Certified Developer exam to first take Foundations as it will give you a good idea of the type of questions to expect. ...

September 1, 2016 · 4 min · 768 words · icarnaghan

Dependency Injection Service Container Example

In an earlier post, I outlined the basics of dependency injection and talked a little bit about the Drupal 8 service container and how we can use this in our code. Day 16 of Drupal Activity Cards provides a task for us to implement dependency injection in one of the Drupal 8 Example modules. The examples module is a great resource for developers getting started in Drupal coding. The modules included gives us basic functionality that provides easy to follow starting points for a number of different needs. For our dependency injection example we are going to look at page_example, a simple module for generating a Drupal 8 page via a controller. A function called simple() returns a basic page. We are going to extend this function to provide a log entry every time a use visits this page. ...

August 22, 2016 · 3 min · 573 words · icarnaghan

Best Nginx PHP-FPM MySQL (MariaDB) stack for Windows

I own a laptop which has a dedicated graphics card. I am a developer who prefers using Linux OS. I’ve tried 3 distros of Linux, Mint, Ubuntu, OpenSuse. No matter what version of Linux I use, the OS fails to recognize the AMD graphics card in my laptop and the WiFi connection always drops. I fixed the WiFi issue by upgrading the driver but the GPU installation always fails. Hence, I decided to give up using Linux and stick with Windows 10 OS for development tasks. ...

August 20, 2016 · 2 min · 402 words · prhost78

Logging in Drupal 8

Logging is very important in any production site because we don’t have the same ability to debug code that we have in our development environments. Drupal 7 had a very robust logging system called watchdog(), which has been replaced by logger in Drupal 8. This post summarizes a basic use case for logging in Drupal 8 continuing the Drupal 8 Activity Cards series on Day 13. Amber Matz breaks down logging in Drupal 8 concisely in How to Log Messages in Drupal 8. In her article, she breaks down the code needed to implement logger and provides solid explanations. The examples provided involve procedural coding in the .module file as does the example I provide in this article. If you are writing controllers or forms that extend ControllerBase or FormBase then it would be better to use the service container to inject logger into your code. ...

August 19, 2016 · 2 min · 384 words · icarnaghan

Introduction to Drupal 8 Theming

Drupal 8 has a new theme engine, however many of the concepts we are familiar with in Drupal 7 are still in place in this new version. Themes still have the same ability to overwrite various templates within core, only now instead of modifying .tpl.php files, you will be creating Twig files in their place. Theme functions are still available to use, however they are now kept in the .theme file instead of template.php. Other changes worthy of exploring in more depth are briefly summarized below. ...

August 18, 2016 · 4 min · 660 words · icarnaghan

Creating a Custom Content Entity Type

Drupal 8 has seen a lot of improvements for content entities and with the new Drupal console, setting up a content entity has been made a lot easier with the addition of boilerplate code generation. Day 11 of the Drupal 8 Activity Card set focuses on content entities, how they can be setup in Drupal 8, how we might add our own custom fields to the boilerplate code provided, and how this is managed within the Drupal 8 administration system. ...

August 17, 2016 · 6 min · 1080 words · icarnaghan

Configuring your Local Drupal 8 Development Environment

I have struggled with properly optimizing my local environment in terms of enabling debugging and disabling cache for a while. There isn’t that many steps you need to cover in order to have a proper working development environment. After reviewing Day 10 I completed setting up my environment the correct way and have outlined this in the following sections. Step 1 Enable settings.local.php Copy and Rename /sites/settings.example.local.php -> /sites/default/settings.local.php Uncomment the following lines in your settings.php file: # if (file_exists(__DIR__ . '/settings.local.php')) { # include __DIR__ . '/settings.local.php'; # } Step 2 Disable Cache Services In your sites/default/settings.local.php file, uncomment the following: # $settings['cache']['bins']['render'] = 'cache.backend.null'; Rebuild your site configuration by visiting yoursite.local/rebuild.php Step 3 Disable Twig Cache and Enable Debugging Add the following lines to your /sites/development-services.yml (Refer to /sites/default/default-services.yml for all options) parameters: twig.config: debug: true auto_reload: true cache: false Clear Cache and then verify Twig debugging has been enabled by refreshing your Drupal 8 homepage. Review your source code and you should see something similar to: <!-- THEME DEBUG -->; <!-- THEME HOOK: 'html' -->; <!-- FILE NAME SUGGESTIONS: * html--front.html.twig * html--.html.twig x html.html.twig -->; Twig debugging gives a lot of helpful information scattered throughout your source code in the form of comments. ...

August 16, 2016 · 1 min · 207 words · icarnaghan