"Mr Branding" is a blog based on RSS for everything related to website branding and website design, it collects its posts from many sites in order to facilitate the updating to the latest technology.
To suggest any source, please contact me: Taha.baba@consultant.com
Friday, October 2, 2015
Building Custom cTools Plugins in Drupal 7
cTools is one of those critical Drupal 7 modules many others depend on. It provides a lot of APIs and functionality that makes life easier when developing modules. Views and Panels are just two examples of such powerhouses that depend on it.
cTools makes available different kinds of functionality. Object caching, configuration exportability, form wizards, dialogs and plugins are but a few. A lot of the credit you would normally attribute to Views or Panels is actually owed to cTools.
In this article, we are going to take a look at cTools plugins, especially how we can create our very own. After a brief introduction, we will immediately go hands on with a custom module that will use the cTools plugins to make defining Drupal blocks nicer (more in tune to how we define them in Drupal 8).
Introduction
cTools plugins in Drupal 7 (conceptually not so dissimilar to the plugin system in Drupal 8) are meant for easily defining reusable bits of functionality. That is to say, for the ability to define isolated business logic that is used in some context. The goal is to set up that context and plugin type once, and allow other modules to then define plugins that can be used in that context automatically.
If you’ve been developing Drupal sites for more than a year you’ve probably encountered cTools plugins in one shape or form. I think the first plugin type we usually deal with is the content_type
plugin which allows us to create our own custom panel panes that display dynamic content. And that is awesome. Some of the others you may have encountered in the same realm of Panels are probably context
and access
(visibility rules). Maybe even relationships
and arguments
. These are all provided by cTools. Panels adds to this list by introducing layouts
and styles
that we normally use for creating Panels layouts and individual pane styles. These are I think the more common ones.
However, all of the above are to a certain extent a black box to many. All we know is that we need to define a hook to specify a directory and then provide an include file with some definition and logic code and the rest happens by magic. Going forward, I would like us to look into how a plugin type is defined so that if the case arises, we can create our own plugins to represent some reusable bits of functionality. To demonstrate this, we will create a module that turns the pesky hook system of defining custom Drupal blocks into a plugin based approach similar to what Drupal 8 is using.
The final code (+ a bit more) can be found in this repository if you want to follow along. And I do expect you are familiar with the steps necessary for defining custom Drupal blocks.
Continue reading %Building Custom cTools Plugins in Drupal 7%
by Daniel Sipos via SitePoint
Coding for the Big Screen with the Apple TVOS SDK
The newly announced tvOS SDK is something for iOS developers to get excited about. For the first time we will be able to create apps for the new Apple TV and publish them to the App Store. This is a great opportunity to deliver content and great user experience through apps to the big screen in everyone’s living room.
Let’s dive right in and take a look at the tvOS SDK.
We’ll cover the basics of each new framework, identify their purpose and describe what the requirements to make an app. Armed with our newfound knowledge, we will create a simple custom tvOS app step by step.
Continue reading %Coding for the Big Screen with the Apple TVOS SDK%
by Patrick Haralabidis via SitePoint
McWhopper
by Rob Hope via One Page Love
This week's JavaScript news, issue 252
|
by via JavaScript Weekly