I Want to bring basic information about the group right away, and under it is the stream.
Without more buttons.
Is that possible?
forgive me for my english again
Without more buttons.
Is that possible?
forgive me for my english
// Get the custom fields steps.
// Get the steps model
$stepsModel = Foundry::model( 'Steps' );
$steps = $stepsModel->getSteps( $group->category_id , SOCIAL_TYPE_CLUSTERS , SOCIAL_PROFILES_VIEW_DISPLAY );
// Get the fields library
$fields = Foundry::fields();
// Enforce privacy to be false for groups
$fields->init(array('privacy' => false));
$fieldsModel = Foundry::model( 'Fields' );
$incomplete = false;
// Get the custom fields for each of the steps.
foreach( $steps as &$step )
{
$step->fields = $fieldsModel->getCustomFields( array( 'step_id' => $step->id , 'data' => true , 'dataId' => $group->id , 'dataType' => SOCIAL_TYPE_GROUP , 'visible' => SOCIAL_PROFILES_VIEW_DISPLAY ) );
// Trigger onDisplay for custom fields.
if( !empty( $step->fields ) )
{
$args = array( $group );
$fields->trigger( 'onDisplay' , SOCIAL_FIELDS_GROUP_GROUP , $step->fields , $args );
}
$step->hide = true;
foreach( $step->fields as $field )
{
// If the key output is set but is empty, means that the field does have an output, but there is no data to show
// In this case, we mark this profile as incomplete
// Incomplete profile will have a info displayed above saying "complete your profile now"
// If incomplete has been marked true, then no point marking it as true again
// We don't break from the loop here because there is other checking going on
if( isset( $field->output ) && empty( $field->output ) && $incomplete === false )
{
$incomplete = true;
}
// As long as one of the field in the step has an output, then this step shouldn't be hidden
// If step has been marked false, then no point marking it as false again
// We don't break from the loop here because there is other checking going on
if( !empty( $field->output ) && $step->hide === true )
{
$step->hide = false;
}
}
}
<div class="es-content-wrap" data-es-group-item-content>
<?php if( $contents ){ ?>
<?php echo $contents; ?>
<?php } else { ?>
<?php echo $this->includeTemplate( 'site/groups/item.content' ); ?>
<?php } ?>
</div>