Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I have a use case where I want to display the group type in the custom breadcrumbs module. There is an og token for [og-type] but I need to display the 'name' of the og-type. I added two lines of code to the og.module to add this token and thought I'd suggest it here so it could be used by others. The code is based on what the token module already does for the node type name.
function og_token_list
$tokens['node']['og-type-name'] = t("Type of top group (user-friendly version)");
function og_token_values
$values['og-type-name'] = node_get_types('name', $group->type);
Comments
Comment #1
shenzhuxi CreditAttribution: shenzhuxi commentedtested and confirmed