mardi 30 juillet 2019

Display text if image is not available

I'm coding a custom SharePoint Item_XX.html template which is feeding in data from my SharePoint custom list. I'm not sure how to 'break up' script though. How do I use an if-else statement where the output displays html?

You'll see I'm trying to say: If there is LogoSrc data, add the data to the image src. Otherwise display text (dtaa from the title field)

<script> if (!LogoSrc==null){ </script>
    <img src="_#= $htmlEncode(LogoSrc) =#_" />
<script> } else { </script>
    <p style="font-size: 13pt; font-family: 'Malgun Gothic', Arial, sans-serif; color: #000000; font-weight: 700;">_#= Title =#_</p>
<script> } </script>

Aucun commentaire:

Enregistrer un commentaire