Can I Use Organic Groups in IMCE Directory Path?

Events happening in the community are now at Drupal community events on www.drupal.org.
bwebster719's picture

We are looking at IMCE to help manage file uploads in an OpenPublish based Drupal site. This site is also going to make heavy use of Organic Groups to help separate content, and manage authoring permissions.

In the IMCE configuration, I see how to add directory paths that a user can access, and I also see how to add PHP to help determine these directory paths. However, I would like to include a directory path for the group(s) this node is posted in, and I'm not able to figure out how to do that. For example, if the node in posted in a Group called Basketball (with a group id of 302), I'd like to include a path like 'groups/Basketball' or 'groups/302'.

I'm not figuring out how to use PHP to get this group ID name or id. What PHP would I include to do this?

Comments

do you solve it??

moneera's picture

do you solve it??

Used Domain Access Instead

bwebster719's picture

No, I never figured out how to get the Organic Group name or ID. However, we later decided to go with Domain Access instead of Organic Groups, and we were able to set IMCE to have the Organic Group name as part of the path.

The PHP to do this in Domain Access was

php: global $_domain; return substr($_domain['subdomain'], 0, strpos($_domain['subdomain'], '.') ) ;

Central Iowa Drupal Users Group

Group categories

Category

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds: