coastercms icon indicating copy to clipboard operation
coastercms copied to clipboard

Unexpected template behavior

Open illuminate3 opened this issue 8 years ago • 1 comments

Intended result: IF email field exists show contact form ENDIF

In my template I have this:

            @if (PageBuilder::block('email'))
                {!! PageBuilder::block('contact_form') !!}
            @endif

The idea is to check if the email field exists show the form if not skip it.

By doing that the Block change doesn't see what's in the IF check.

Work around: delete the if/endif and run the block update check. Then paste back the the if conditional.

illuminate3 avatar Feb 24 '17 14:02 illuminate3

This is probably to do with what the 'email' block is returning. We've recently added an option to the blocks 'review_return_value' which will force the theme review function to see whatever you pass through like this:

@if (PageBuilder::block('email', ['review_return_value' => true]))
                {!! PageBuilder::block('contact_form') !!}
@endif

This should solve the problem...

chadanuk avatar Feb 24 '17 15:02 chadanuk