spaces
Spaces Integrating a CCK Field
grayside — Mon, 07/26/2010 - 12:25
I wanted to make a CCK Field available only when a given feature was enabled. It turns out it’s really easy.
CCK comes with a hook_field_access() hook (see content_access()). Any implementation of this function that returns FALSE for a given field results in that field being denied to the user.
By implementing this function with a Spaces API call instead of the content_permissions module approach of a new, field-specific permission, all kinds of magic becomes possible.
Read on for demonstration code.
Integrating Some Other Feature with Spaces
grayside — Fri, 07/23/2010 - 08:10
I have found more than once a situation in which I had a basic feature that could be used on any site which I would like to see integrated with Spaces (for OpenAtrium magic). It usually runs like this:
- I have the FeatureServer feature.
- I want it in OpenAtrium.
- Here’s a new Feature that provides some Contexts and some Groups variables.
- Here’s a patch that you must apply to FeatureServer to make Spaces aware of it. (And other stuff).
Optional Spaces Integration for a View
grayside — Tue, 06/15/2010 - 13:05
If you want to make an exported [node-based] View smoothly integrate with Spaces, you can use the following code to modify the View structure with the “Content in current space” filter. This filter does nothing if the View is not itself in a Space, otherwise it restricts all results to content in the same space. Add any conditions you want to control whether the Spaces integration is applied.
Spaces Private Content
grayside — Wed, 03/31/2010 - 08:35
I am using Spaces with OpenAtrium in several Intranet-like scenarios. However, my repeated pattern is a group with a public face, public listings, some public news and documentation, and then a bunch of private stuff that should only be exposed to members. Unfortunately, spaces_og, the Spaces sub-module that provides group integration, completely overwhelms any fine-grained option to control individual node privacy settings
Simple Spaces Recipe for a Static Welcome Widget
grayside — Sun, 03/07/2010 - 00:33
One of the little conundrums in OpenAtrium (and I imagine in Spaces) is building static content for the space. (Or in OpenAtrium terms, getting a nice dashboard box to stay put, yet be customizable by group.)
There are countless ways of doing this, but I opted to create a CCK Textarea field in my group content type (named field_group_welcome_message) and turn on the PHP filter.
Then I created a Box (which is what OpenAtrium uses, could just as well have been a block) using the following snippet: