Blog

Regex to the rescue

  • Posted on: 28 July 2016
  • By: h

In Spring Tool Suite, refactoring a package name will look for every possible file name, including hidden files. That usually causes hangups on the file search. 
The solution is to use the following regular expression to skip the files starts with a dot.

^[^.].*$
The regex reads anything that does not start with a period ( . ).

Drupal Console and CentOS

  • Posted on: 24 April 2016
  • By: h

URL: https://github.com/hechoendrupal/DrupalConsole/issues/1842#issuecomment-214076492

It seems that submitting a comment is trivial, but the thread discusses an issue where Drupal Console runs into Segmentation Fault on CentOS, particularly in Bluehost services. The amount of relief that the resolution is reachable is immeasurable. To repeat:

In /usr/lib/php.ini, comment out the following line

zend_extension="/usr/local/IonCube/ioncube_loader_lin_5.6.so"

The running the following line works with output shown:

$ ./drupal.phar init --override
Copied files
User home path: /home/holingpo/.console/
1 - aliases.yml
2 - chain/create-data.yml
3 - chain/form-sample.yml
4 - chain/quick-start-db-env.yml
5 - chain/quick-start-db.yml
6 - chain/quick-start.yml
7 - chain/sample.yml
8 - chain/site-drop-restore.yml
9 - chain/site-install.yml
10 - chain/update-gitbook.yml
11 - commands.yml
12 - config.yml
13 - phpcheck.yml
14 - router.php
15 - site.mode.yml
16 - sites/sample.yml

Bash or Zsh: Add this line to your shell configuration file:
source "$HOME/.console/console.rc" 2>/dev/null

Fish: Create a symbolic link
ln -s ~/.console/drupal.fish ~/.config/fish/completions/drupal.fish

The full thread of the discussion is available via URL at beginning of this post.

Twitter

  • Posted on: 21 November 2015
  • By: h

Yup, finally broken down and make Twitter feed appear on the site. It is definitely an excellent exercise of adding Twitter module, with Oauth enabled already, and some editing in the Twitter Block view to make sure there are not too many tweets or the tweets are too crunched together.
 
To see my Twitter account, just click on the Twitter icon listed to right of site title. 

Embedding YouTube Playlist

  • Posted on: 29 July 2015
  • By: h

Edit: The playlist is removed for the time being because it is not responsive which is not a good fit with this responsive layout. Maybe it's time to do some responsive sleuthing...

The new experiment involves embedding entire YouTube playlist on Drupal.

That is as easy as creating a new block, set the Text Format to Full HTML, and copy and paste the Embed code from YouTube when you're at the playlist.

I have also removed the slideshow from the Multipurpose layout because it looks too busy to have a slide show and a YouTube video screen on the front page. So see you later, slideshow.

States and state capitals

  • Posted on: 4 May 2015
  • By: h

Many things were promised on this blog, but this is a playpen for all things Drupal. So. Next project to give me a clearer mind set is to write a module that'd add state and state capitals using Drupal 7 Entities. Stay tuned.
Edit: It is finally here! States is a fully fleshed out Drupal 7 Entity. Basic CRUD operations, plus listing of all data and breadcrumbs on the page are available. Go check it out!
States list

Add Instagram Link and Icon in Multipurpose

  • Posted on: 25 April 2015
  • By: h

Multipurpose theme comes with a handy Social Media icon panel. By default, admin can go into the theme settings and fill out the urls for the default social media links: Facebook, Twitter, Google Plus and Pintrest.

To add a new icon to the panel, such as Instagram:

multipurpose.info

settings[instagram_url] = "http://instagram.com"

theme-settings.php

$form['multipurpose_settings']['socialicon']['instagram_url'] = array(
    '#type' => 'textfield',
    '#title' => t('Instagram Address'),
    '#default_value' => theme_get_setting('instagram_url', 'multipurpose'),
    '#description' => t("Enter your Instagram URL. Leave blank to hide."),
  );

templates/page.tpl.php

Under
theme_get_setting('socialicon_display', 'multipurpose')
$instagram_url= check_plain(theme_get_setting('instagram_url', 'multipurpose'));
 
Under header-social div
<?php if ($instagram_url): ?><li>
<a target="_blank" title="<?php print $site_name; ?> in Instagram" href="<?php print $instagram_url; ?>"><img alt="Instagram" src="<?php print base_path() . drupal_get_path('theme', 'multipurpose') . '/images/social/instagram.png'; ?>"> </a>
</li><?php endif; ?>
 
Don't forget to clear caches after saving all the files.

Pages