content profile

Migrate Classes: Content Profile to Profile2

This installment of the Migrate Classes series will give you a bit of sample code for migrating Content Profile nodes (D6) to Profile2 entities (D7).

Please note that this is not a tutorial for the Migrate module. If you'd like a detailed explanation of the Migrate API, please check either the examples in the Migrate module, or read this excellent blog post on the migrate module.

Here's a bare bones migration class that will query a base node table, join the necessary CCK field table, and migrate them into a Profile2 entity. Please note that you will require the Migrate Extras module to perform this migration.

Prepopulating Ubercart's address field with Content Profile values

This is a custom solution that uses hook_form_alter() to prepopulate the Ubercart Address field with fields from the logged in user's Content Profile.

Add address field to Signup form, save to Content Profile

Alright, so this a bit nuanced, but I thought that I'd share it anyway. Maybe this snippet will help someone somewhere.

Scenario

I'm using the Signup module to permit users to signup for events, but I'd like them to be able to enter more than the standard name and phone number. I'd like my users to be able to provide their address.

Beyond that, if the user has already provided their address on their user profile (generated using Content Profile and the Location CCK module), then I'd like the fields to prepopulate.

Furthermore (we're getting crazy here), if they enter a new address on the signup form, I'd like them to be able to save that address to their profile.

Whoa!

Actually, with the power of the Forms API, this becomes an easy task.

Subscribe to RSS - content profile