Hi

How to check in elms site whether current viewed node is a course content ? Is there any specific functions defined in elms custom modules.

Tks in advance
-Vil

Comments

btopro’s picture

shouldn't need anything outside of drupal core to do this

$group = og_get_group_context() will always supply the group that's in context (elms site)

If you want a specific content type being accessed, you can do the following

$node = menu_get_object();
if (isset($node->type) && $node->type == 'page or whatever type you want here') {
  //do something
}

Elms Content defines the page, link and folder types. ELMS site defines site and ELMS parent defines parent (just a high level organizer).

As much as possible ELMS seeks to simply implement conventions established by OG and Spaces when it comes to data management and organization.

invincible1388’s picture

Hi

I have added a custom content type in course system.But when i check in my custom node-type devel fields, the "og_groups_both" field comes empty.
Its populated in other node types.So what has to be done so that "og_groups_both" field comes populated with appropriate group-id's.

Tks,
-Vil

btopro’s picture

Did you make sure it's been told that it's allowed to be posted in groups? It need to have the setting of group content selected.

invincible1388’s picture

I have set the permissions in the group settings to "Standard group post (typically only author may edit)" for my custom node type.Still the "og_groups_both" field is coming empty for the custom node type. The field has the group information in other node type.

Is there any other configuration I am missing?

Tks
Vil

btopro’s picture

Do you have a menu item link within a group that has a path that makes sense to the group. For example mysite.com/node/add/type, even when accessed within a group will NOT associate it to the group. Make a menu link that you have access to within groups (like a menu that's in a block or navigation and place that in the left region via context). Then make sure the link has

Persistant URL behavior
All links are normally rewritten to contain the active persistant url elements. You may set this item to maintain existing modifications (the default), or to discard them.
BEHAVIOR: MAINTAIN

If you don't maintain the PURL setting for the link it won't modify node/add/type to {currentgroup}/node/add/type and then won't be able to populate the group setting automatically.

invincible1388’s picture

Got it running by group->nid by calling og_get_group_context() which also returns the group nid.

Tks
-Vil

btopro’s picture

Status: Active » Fixed

og_get_group_context() is your friend at all times :)

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.