jmccole83
2/6/2019 - 11:37 AM

Conditional Laravel Output

Output conditional HTML if a custom field has content.

@if ( !empty($content_block->link_url) )
  <a class="view-more" href="{!! $content_block->link_url !!}">{{ $content_block->link_text }}</a>
@endif
case 'carousel':
  $content_block->content = get_sub_field('carousel');
  $content_block->link_text = get_sub_field('carousel_link_text');
  $content_block->link_url = get_sub_field('carousel_link_url');
  break;