- hook_views_api - this declares that you're going to do something 'viewish' with your custom module. This function returns an array specifying the lowest views api version you'll support, and where your module is located. See http://views.doc.logrus.com/group__views__hooks.html#gc67ffd4a2f61f9814ee37b541c472c47hook_views_data
- hook_views_handlers - here you announce to Drupal that you're implementing an handler. This hook specifies you'll specify the parent class and the filename your class lives in. See http://views.doc.logrus.com/group__views__hooks.html#gbf506f44bd8d8a86876f27396f5341ed
- hook_views_data_alter OR hook_views_data - these hooks tell Views where your handler fits into the data model that views uses to generate queries. For simple filters that rely on existing tables, use hook_views_data_alter to add your handler to, say, the information already related to the node module. If you've got a whole module with its own tables, you'll want to describe them to views using hook_views_data. The array that describes your data to views does so field by field, specifying what kind of field, argument and filter handlers your fields will use. You'll also be able to specify relationships and joins to other data in hook_views_data. See http://views.doc.logrus.com/group__views__hooks.html#g227057901681e4a33e33c199c7a8c989
Friday, March 18, 2011
Creating a views handler for Drupal 6 - Part I
Monday, January 24, 2011
subuser access
Modules that we're using to enable the org->member relationship.
CCK - defines the content types for org and contact
Content profile - associates the contact cck type with users. Had to be patched with this: http://drupal.org/node/425144#comment-3410500 to add a permission to allow content profiles to be administered by roles other than admin.
subuser - allow users to create users under their account, and edit/delete them.
Subuser required two patches to work with content profile. They're both found on this issue: http://drupal.org/node/571660#comment-3984138
Permissions required to get all this working:
- content profile module::administer content profiles
- subuser::administer subusers
- subuser::create subuser
views_attach - used to put a list of content profiles on the organization node based on the 'belongs to' nodereference field on contacts.
For users who don't have the 'administer users' permission, you'd think you can visit the profile of any of their subusers, but that's not always the case. The core user module throws an access denied error when you try to visit the profile of a non-logged in user and you don't have administer users permissions. There are some cases where a non-admin user like the ones on my site might want to edit their users regardless of whether they've logged in or not. For instance, if I type in an email address wrong, I'll want to fix that, but I won't be able to visit their user profile. I can visit their edit screen, but not the user profile. The subuser module overrides the user/%/edit access_callback, but not the one for the view page. May have to adjust that in the subuser module and file a patch.
git setup for new drupal site.
- cd'd to my site root.
- rashly ran 'git add .'
- ran 'git rm -r --cached sites/default/files/*', 'git rm -r --cached backup/*', and 'git rm --cached sites/default/settings.php'
- created a .gitignore file in the root of my drupal site. It contains the following lines:
backup/*
sites/default/settings.php
sites/default/files/*
That will ignore those directories in the future when I got to commit or update.
- ran 'git remote add origin git@github.com:{repo_path_here}' and 'git push origin master'
noderelationships and nodereferrer
What to do when Cron gets stuck...
nice menus + context
- the theme function that nice menus uses to style its list items: {themename}_nice_menus_build
- the function in the context module that gives you the active contexts: context_active_contexts()
I get my active contexts inside the theme function, and set any menu reactions into $context_active_trail. Later in that function, I compare them with the menu being built:<code>
if ($context_active_trail) {
if(in_array($menu_item['link']['link_path'], $context_active_trail)){
$trail[] = $menu_item['link']['mlid'];
}
}
</code>The trail variable is used next to test the current menu item and set the active-trail class if it matches. Now Nice menus respects Context's active menu assignments. It would be nice if I went back and figured out the process to do it the right way, where the theme isn't so tightly coupled to the context module.
Monday, August 23, 2010
embedded media video provider notes
validation hook isn't implemented in the example, but is called from emfield module.