Issue
i am retrieving information from the database and using {%if%} and {%endif%} condition so if that field is blank it does not cause any problem but when that field does not have any value it creates a new blank line in place of that looks bad in styling I saw an answer use this {%if -%} {%- endif %}it doesn't work and throws the error all I want if field is blank do not create any new blank line and render second line below that without creating any whitespace any suggestion will be helpfull
Solution
You could format like this:
My first line{% if second_line %}<br>
{{second_line}}{% endif %}<br>
My third line
The idea being if second_line
doesn't exist it won't render that <br>
Answered By - Nealium
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.