Joining Drupal (CCK) Fields To Other Base Tables Through Views

Working on a D6 CCK site today, so the code is slightly outdated but can likely be adapted for D7 fields quickly enough. What we had was a seperate system of key levels available to users in the system coming from a custom module. These levels were defined in a table exposed to views through the api previously. Today, we needed to create a field on a node that contained a reference to a level. There was no way to do this directly though views, as our custom base table was a loner. That left two possible options:

  1. Create a simple integer field containing the ids of the key levels as a field on the node, and create the relationship in views after 'somehow'.
  2. Create a new type of field 'something' like node reference that pointed back at our levels.

While I admin, #2 is the far stronger option for an admin controlling the system manually, that wasn't the case for us this time. The field itself is going to be updated by various events through many parts of the system. Creating a special field type just for this would have been a waste of time since the admin isn't even allowed to edit the field. So, here's how we accomplished number one.

Tags: 

Mass updating magento product weights from a csv

Handy trick in case you don't know the magento database structure well. This worked in magento 1.7.0.2.

Tags: 

Magento - Error Saving Configuration - Array Encrypted.php

An error occurred while saving this configuration: Warning: preg_match() expects parameter 2 to be string, array given in app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Encrypted.php on line 62 - Magento version 1.7.0.2

Tags: 

Magento import reviews

Need to import reviews from your old system to Magento? Try this code as a starting point.

Tags: 

Pages

Subscribe to Fragmented Thought RSS