This guide will focus on the
radios type, but it can be use for
checkboxes in the exact same way.
TL;DR: Put an
#after_buildon form checkboxes or radios (or on the form element itself). Within the
after_build, the items will be normal
When using FAPI with
#type => 'radios', it becomes quickly obvious that defining or altering the individual radio items is difficult, as all options go into the nested
Creating and manipulating content (entities) has become much less complex with EntityAPI in Drupal 7.
There are lots of examples out there for manipulating nodes, creating custom entity types, etc. Here's a quick one for programatically creating a comment entity and attaching it to a node.
Now that we've got our server instance up and running with CentOS 6.5 (RHEL 6), there's a few things to check on before proceeding.
Configure & Update
As a first step, after logging in, lets update the server packages with
$ yum update -y. Next, change your root password with
There are lots of other things you should be doing at this point which will be covered in the Security section of this series. This includes things like:
Along with git, drush ― [Dru]pal [Sh]ell ― aliases are an extremely useful, and powerful tool when dealing with a drupal dev-stage-production workflow.
The idea is simple: create an alias for your different environments, allowing you to perform drush tasks on remote servers. Included is additional functionality such as syncing files, databases, or using any other drush command - even the usual
drush cc all et al.
Shared? VPS? Dedicated? Colocation? Cloud?
The first step in our PWS is an important one: choosing the type of hosting and a provider. There is no one correct answer, and everyone has their own opinions & requirements.
To start, the idea of shared hosting is nice. Set it up, forget about it. No sysadmin / devops. Sure, Pantheon is geared towards Drupal, and it's a great service. But not a lot of clients are willing to pay $400+/month for hosting one site. Finally, later in this series we'll be discussing a lot of additional packages not usable with shared hosting.
This series will aim to become a reference to creating an ideal Production Webserver. It is geared towards Drupal configurations, but can be used for any server whose main function is to serve webpages.
Creating a performant, secure, scalable, redundant, production server environment can be (is) a complicated task. Having managed dozens of servers for many years, by no means is this the only way to go. But if you're administering your own server with a lot of clients, this is what works for us.
Recently we upgraded a cloud server instance, which involved creating an image of the instance and restoring it on a new hypervisor. After the successful migration, everything seemed to be working well. That is, until trying to ssh to the server:
$ ssh firstname.lastname@example.org Unable to get valid context for skh Last login: ... Connection to example.com closed.
Google advises that when using Apps for e-mail your domain should have a SPF/TXT record with the value
v=spf1 include:_spf.google.com ~all.
An issue that may arise is e-mail providers marking the message as spam if you are sending e-mail from your web server as well as google's servers. For example, user account registration validation, contact form submissions, and anything that may come from an address such as email@example.com on a website.
Installing node.js on OSX (and presumably Windows) is very straightforward with the binaries provided on the node.js download page. However, on servers such as RHEL variants like CentOS, it takes a couple of extra steps.
A non-exhaustive list of technologies, services, packages, etc used to create e9p.net.