I have migrated a channel to using a fluid field instead of the old setup of one body field and one extended text field. The fluid field includes a textarea and a grid field that of course can be used any number of times each.
I managed to sort out that the index displays only the first instance of the textarea and the first instance of the grid field even if there are more. I do that like this:
{westeros_content}
{westeros_content:westeros_text}
{if {westeros_content:count name="westeros_text"} == "1"}{content}{/if}
{/westeros_content:westeros_text}
{westeros_content:westeros_image}
{if {westeros_content:count name="westeros_image"} == "1"}
{content}
<div class="EntryImage">
<a href="http://{content:file}">{content:image:medium}</a>
</div>
{content:caption}
{/content}
{/if}
{/westeros_content:westeros_image}
{/westeros_content}
However, I would also like to offer a “read on” link IF there us more than one text field, and I can’t seem to figure out how to construct that. What I tried was this:
{if {westeros_content:count name="westeros_text"} > "1"}
<div class="EntryExtended"><a href="http://{comment_url_title_auto_path}">read on >></a></div>
{/if}
And that gives me the following error:
Error
You have an invalid conditional in your template. Please review your conditionals for an unclosed string, invalid operators, a missing }, or a missing {/if}.
Parser State: Invalid Condition: Not enough operands for operator ” > “.
In Template “Announcements/index” on line 90
Removing the inner curly brackets also do not work, so I can’t quite figure out what I am missing here.