Skip to main content

/* commented */

Occasional comments on coding, CSS, Symfony, Drupal, and other related and completely unrelated matters.
Views Flexbox: Drupal 8 views style plugin
Drupal 8 Flexbox
The Flexbox CSS spec is now supported by most modern browsers, so it's time to get Drupal 8 Views in the game. This views plug-in gives you a new option for styling your views in Flexbox fashion. Our CSS is based on Lee Jordan's Reflex project - but you're not bound by that. Note: very early days - this is release 0.1.0.
Drupal jCarousel: implementation of a basic skin
Drupal Code Module
add skins to jcarousel in drupal 7

The Drupal jCarousel module usefully integrates the jCarousel image (or content) rotator with Drupal, and specifically with views, allowing you to populate the rotator via any view. The default skins are looking a little tired. It's an easy if slightly tedious process to create your own skin, following the example of the provided Default skin. At github we've posted a ready-to-go skin that doesn't require any images, thus sparing you the most tedious part of the work.

Add an image field to an entity, using vichuploader

The process of adding file uploads to an entity is documented in the Symfony cookbook. As one quickly notices, the default technique requires you to hard-code a file path within the entity, and copy-paste some dull code. The VichUploader Bundle (get it at github) moves required paths to the config.yml file and abstracts some of that code away. But you'll still need to mess about when you add an image or other uploadable item to your entity.

On utilitarianism, code, and robots

John Stuart Mill codified his father-in-law's philosophical notions into the moral school known as utilitarianism. In simplest terms, Utilitarianism suggests that any moral questions should be resolved by following the principle of "the greatest good to the greatest number." In common practice this resolves, for example, to such dictums as "nobody gets two until everyone has had one."

Overriding FOSUserBundle Forms in Symfony2

It's relatively easy to customize FOSUserBundle behavior by creating your own child bundle, with FOSUserBundle as the parent. Once you've done this, you can provide your own registration and profile forms - as long as you remember all the small steps. This is intended first and foremost as a simple reminder of the steps involved. Code examples follow, but may or may not be exactly what you need. We will assume that you have created an MemberBundle, and declared it a child of FOSUserBundle. We'll demonstrate using the Registration form.