Is there a better way to write this?
{if logged_in_group_id == "1" || logged_in_group_id == "6" || logged_in_group_id == "7" || logged_in_group_id == "11"}
Hello Members...
{/if}
It seems very long.
Version 2.9.0
To add to Blatant's comprehensive answer and keeping native without PHP...
{if "|1|6|7|11|" *= "|".logged_in_group_id."|"} ... {/if}
Well, you don't say what version of EE you're using, so I'm gonna assume v2, though this solution should work just fine in v3 too.
the quickest method would be PHP's in_array()
function, which you can use in your template natively, however so that I don't give a PHP answer first here's a plugin that adds in_array to EE :
https://devot-ee.com/add-ons/in-array
{if '{exp:in_array value=“2” array="1|6|7|11"}'}
Hello Members...
{/if}
If you rather add plugins that should get you there, you can shorten your EE tags as well, as group_id
will be 0 for non logged in members :
{if group_id == '1' || group_id == '6' || group_id == '7' || group_id == '11'}
Hello Members...
{/if}
Or if you're not afraid of a bit o PHP and the parse order :
EE v2.X
<?php if ( in_array( ee()->session->userdata('group_id') , array ( 1, 6, 7, 11 ) ) ) { ?>
Hello Members...
<?php } ?>
EE v3.X
<?php
global $SESS;
if ( in_array( $SESS->userdata('group_id') , array ( 1, 6, 7, 11 ) ) ) {
?>
Hello Members...
<?php } ?>