Monday, January 25, 2016

Drupal performance improvement (valid for version 7)

Abstract

Drupal version 7, objective is to improve both Desktop and mobile versions of your website, improve SEO ratings like page loading speed, text to HTML ratio, number of CSS files, Javascript footprint size, overall page footprint size, number of files to load.

Improvement process

Drupal is module based CMS, so you are going to need only a couple of modules added to your installation. Each module and its use follows. Hopefully this article will be updated quite a few times.

PHP filter + Browscap

There are a couple of Drupal modules that allow hiding content based on device size (mobile or desktop). Tried quite a few Mobility modules, but none of them seem to work, where old or required modules like Cache to be turned off. And its not what I wanted.

In mobile versions I sometimes disable large slideshow blocks or page images, if you are up for that, here is what you do: download browscap, deploy it and enable both modules (PHP filter is native Drupal module). Open you block, enable PHP condition and paste this snippet:

<?php 
$mobile_agent = browscap_get_browser() ;
if($mobile_agent['ismobiledevice'] == "false"){return true;}
?>

Minify

This module simply removes all the unnecessary characters from your HTML and Javascript files. Compresses and creates copies of all you Javascript includes. This makes your files download faster. Some of the files are not being compressed due to their already small footprint, pay no attention to them. I will not describe how to use this module, its self explanatory. Once deployed you will find it under cache/performance management. Link for download. Suggesting enabling it when production ready since output HTML and JS files are hardly human readable.

Advagg

Full module name is Advanced CSS/JS Aggregation. This module combines (even cached) css files into a single file, which gives quite a few performance points in some of SEO evaluation tools. Combining your CSS files also reduces text/html ratio. Setup has quite a few tabs, but just follow the setup and enable CSS compression.

Summary

Usage of all these modules above may improve your website SEO evaluation by up to 10%. If not, then they will at least improve your page loading speed and overall performance compared to your competitors. Any feedback to this article is highly appreciated.

Thursday, January 7, 2016

Oracle Apex Textarea printing with line breaks

Objective

Use Text Fields or Text Area fields for text input to build a document template generator. Oracle Apex version 4.

Problem(s)

With version 4 Apex introduced quite a few variable session handling changes, if you had a long experience with V3 - you will be stuck quite a few times. When you enter text in Rich Text editor or Text Area field and later try to print it in HTML area - either all HTML tags are exposed or removed. In the end you get plain text with different level of garbage. In V3 you could solve this by copying text to a simple Display Only item and use it hidden, then all the HTML tags could be prevented. Here are the three Text Areas used. Text with simple line breaks () or paragraph breaks (+) - which are invisible in UI of Text Area. 

Solution


In HTML area add <pre> and </pre> tags for the Text Area fields. Same tag applies if you change your item to read-only on display. Print preview looks great.