Hi there,
i like to code something like:
if body !=”” AND comments_allowed
i played around and tryed some conditionals to no avail, i did even try
{if body !="" AND if_allow_comments==TRUE}how can i get this to work?
This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.
The active forums are here.
May 08, 2008 8:45am
Subscribe [2]#1 / May 08, 2008 8:45am
Hi there,
i like to code something like:
if body !=”” AND comments_allowed
i played around and tryed some conditionals to no avail, i did even try
{if body !="" AND if_allow_comments==TRUE}how can i get this to work?
#2 / May 08, 2008 8:53am
Why, you could simply nest them:
{if allow_comments}
{if body != ""}
...
{/if}
{/if}#3 / May 08, 2008 9:36am
Thanks Ingmar.
I did not know that you can nest conditionals so easily. My fault probably was using if_allow_comments instead of
if allow_comments.
However i did solve my inlined Read more link problem. I use Textile and with Textile you avoid sourrounding a paragraph with tags when inserting a whitespace at the beginning of the paragraph. Instead you can insert
p.
Lorem ipsum….more text
on the html sourcecode one can use
{if body !=""}{body}{if:else}{summary}{/if}
{if summary !=""}<span class="read-more"><a href="http://{homepage}/{my_template_group}/artikel/{url_title}">Read more…</a></span>{/if}
{if body !=""}{if allow_comments}<span><a href="http://{url_title_path=">Comment</a></span>{/if}{/if}It´s not the nicest solution though..