protected function og_CrumbsMultiPlugin_group_post::getParentPath in Crumbs, the Breadcrumbs suite 7
Same name in this branch
- 7 plugins/crumbs.og.inc \og_CrumbsMultiPlugin_group_post::getParentPath()
- 7 plugins/crumbs.og.2.inc \og_CrumbsMultiPlugin_group_post::getParentPath()
Same name and namespace in other branches
- 7.2 plugins/crumbs.og.inc \og_CrumbsMultiPlugin_group_post::getParentPath()
- 7.2 plugins/crumbs.og.2.inc \og_CrumbsMultiPlugin_group_post::getParentPath()
This method can be overridden by custom plugins that inherit from this one, e.g. to set a different parent for group events than for group discussions.
Parameters
int $group_nid: Node id of the group that was found to be the parent.
stdClass $group_post: The node that is in the group, and that we are trying to find a parent path for.
Return value
string A parent path. The native implementation returns just node/$nid. Custom module might subclass this class and override this method, to let it return e.g. node/$nid/events, or node/$nid/forum, depending on the $group_post argument.
2 calls to og_CrumbsMultiPlugin_group_post::getParentPath()
- og_CrumbsMultiPlugin_group_post::findParent__node_x in plugins/
crumbs.og.inc - og_CrumbsMultiPlugin_group_post::findParent__node_x in plugins/
crumbs.og.2.inc - Attempts to find a breadcrumb parent path for node/%. If that node is in a group, it will return the group page as a parent.
File
- plugins/
crumbs.og.2.inc, line 78
Class
- og_CrumbsMultiPlugin_group_post
- Use the group node as a parent for group posts. The priorities can be configured per group content type.
Code
protected function getParentPath($group_nid, $group_post) {
return 'node/' . $group_nid;
/*
* Example:
* switch ($group_post->type) {
* case 'event':
* return 'node/' . $group_nid . '/events';
* case 'discussion':
* return 'node/' . $group_nid . '/forum';
* default:
* return 'node/' . $group_nid;
* }
*/
}