Displaying list of endorsements which are not featured
I'm working on a custom template for my endorsements page. I want the featured endorsements to show in a list at the top, and the non-featured endorsements to show below that. Here is the code I am trying to use:
{% raw }
{% for endorsement in page.endorsement.featured_endorsements } {% if endorsement.is_organization? }
{{ endorsement.signup.employer }} - {{ endorsement.signup.published_name_linked }}, {{ endorsement.signup.occupation }}{{ endorsement.content }}{% else }
{{ endorsement.signup.published_name_linked }}{{ endorsement.content }}{% endif } {% endfor } {% for endorsement in page.endorsement.endorsements } {% if endorsement.is_organization? }
{{ endorsement.signup.employer }} - {{ endorsement.signup.published_name_linked }}, {{ endorsement.signup.occupation }}{{ endorsement.content }}{% elsif endorsement.is_featured? } {% else }
{{ endorsement.signup.published_name_linked }}{{ endorsement.content }}{% endif } {% endfor }
{% endraw }
The problem is with the elsif statement in the second half. You can see that it is an empty elsif, because if the endorsement is featured I don't want anything to be displayed. However, it isn't working. All endorsements are displayed, so featured endorsements end up being displayed twice. What am I doing wrong?
Official response from Lilia Villa completedMatthew:
If you just want to list the Endorsements, the liquid would look something like this.
{% raw }
<div class="padtop"><h4>Featured Endorsements</h4></div>
<div class="padtop">
{% for endorsement in page.endorsement.featured_endorsements }
{% if endorsement.is_organization? }
{{ endorsement.signup.employer }} - {{ endorsement.signup.published_name_linked }}, {{ endorsement.signup.occupation }}
{% else }
{{ endorsement.signup.published_name_linked }}
{% endif }
{% endfor }
</div>
<div class="padtop"><h4>Endorsements</h4></div>
<div class="padtop">
{% for endorsement in page.endorsement.endorsements }
{% if endorsement.is_organization? }
{{ endorsement.signup.employer }} - {{ endorsement.signup.published_name_linked }}, {{ endorsement.signup.occupation }}
{% else }
{{ endorsement.signup.published_name_linked }}
{% endif }
{% endfor }
</div>{% endraw }
------
That would generate a list of Endorsements for both featured and regular entries.
Add ability to add image captions through WYSIWYG editor
The ability to add a small caption to an image through the editor would be invaluable.
It fixes it right away.
Consider all event slugs being >nation</events/>slug<
Or blog posts:
>nation</blog/>year</>month</>slug<
Or planks in a campaign platform:
>nation</platform/>slug<

