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? }
{% else }
{% endif } {% endfor } {% for endorsement in page.endorsement.endorsements } {% if endorsement.is_organization? }
{% elsif endorsement.is_featured? } {% else }
{% 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?
Matthew:
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.
Showing 9 reactions
Sign in with
On an endorsement page you can make an endorsement featured(which means that it will be displayed in it’s own “Featured endorsements” section of endorsement page) by going into your Endorsement page’s “endorsement settings” and then selecting “endorsements”. You can then click the pencil icon next to an endorsement to edit it. Then, there’s a checkbox with the label “Feature this endorsement above the regular list” which allows you to make that endorsement featured.
Hines Digital
Certified Architect
Certified Expert
Tim Wayne
Certified Architect
Certified Expert
Check by cStreet - Mobile event check-in for organizers
Certified Architect
Certified Developer
{% for endorsement in page.endorsement.featured_endorsements %}
<div class=“endorsement_quote”> {{ endorsement.content }} </div>
<div class=“endorsement_signature”> ~{{ endorsement.signup.published_name }} </div><br>
<div class=“endorsement_link”><a href=“/endorsement”><h5>read more endorsements</h5></a></div>
{% endfor %}
I tried to create an HTML page using this code, but it doesn’t pull in the information from my endorsements.
I looked at the leaderboard set-up, but that doesn’t seem to fit my needs — I really just want to highlight all of the endorsers on a individual page.
Thanks!
Sara