• Uncategorized

    Creating Field Groups in a Custom Module

    If you need your module to add a fieldgroup to your Drupal 7 site, follow this quick and easy process: Also, if you’re looking to create fields, see this related post.

    1. Build the fieldgroup through the “manage fields” UI.
    2. Modify the code below to include a proper $fieldgroup_name, $entity_type and $bundle_name. I needed to add a field to the user profile, so I set the $entity_type to “user” and the $bundle_name to “user”.
  • Development

    Creating Fields in a Custom Module

    I’m going to be very brief here, because Joel Stein covers this beautifully. Also, if you’re looking to create fieldgroups, see this related post.
    If you need your module to add a field to your Drupal 7 site, follow this quick and easy process:

    1. Build the field through the “manage fields” UI.
    2. Modify the code below to include a proper $field_name, $entity_type and $bundle_name. I needed to add a field to the user profile, so I set the $entity_type to “user” and the $bundle_name to “user”.
  • Development

    WordPress Plugin: Search Regex

    I wanted to quickly mention this plugin as it saved me a bit of time just now. While I worked on this new blog I set the development site up at wordpress.agileadam.com. When I switched the agileadam.com domain over to point to this new WordPress site all of my images stopped working (because the img tags pointed to wordpress.agileadam.com urls; shouldn’t they be relative anyway!? I’ll look into that later).

  • Development

    Add Links to Anchors Automatically

    The following snippet is something I used recently to add (below the current item in a menu) links to any anchors found in the content.

    Honestly I could probably create the <ul> outside of the each() loop and save having to check whether it exists with each iteration. Also, it’s probably not necessary to create the aname variable, but the overhead here is minimal.