I have two fields in the back-end, an image field and a text area for YouTube embed code. I want to show the image field in the template only if the textarea has no value. I'm new to SS; my approach for this was to create a function in my page class to return a bool if the textrea has a value. On the front-end template I will access that bool in a conditional block like so:
<% if hasEmbedCode %>
$VideoEmbedCode
<% else %>
$PlaceholderImage
<% end_if %>
I'm not sure how to write the hasEmbedCode() function to return a bool based on the value of the Embed Code field.