Hi,
it would be great, if there is a variable like is_member available in twig for a more individual theming.
is_member
dercheffe created an issue.
Subscribe.
The way I implemented this is:
Create a function in a module that performs the checks you need (i.e. is user member of a group, has a role, etc).
function hook_preprocess_group(&$variables){ // do your logic checks here $variables['group']->is_member = "yes"; }
By returning that logic check value to $variables['group'], it becomes available in your twig template: {{ group.is_member }}
Comments
Comment #2
Anonymous (not verified) commentedSubscribe.
Comment #3
sacha05 commentedThe way I implemented this is:
Create a function in a module that performs the checks you need (i.e. is user member of a group, has a role, etc).
function hook_preprocess_group(&$variables){
// do your logic checks here
$variables['group']->is_member = "yes";
}
By returning that logic check value to $variables['group'], it becomes available in your twig template: {{ group.is_member }}