Matthew Petty's activity

Dennis Yuen tagged Matthew Petty's Displaying list of endorsements which are not featured with Helpful 2012-09-19 11:57:13 -0700

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 completed

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.  


Julie Niemi tagged Matthew Petty's Add ability to add image captions through WYSIWYG editor with Website 2013-05-01 14:51:26 -0700

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.


Matthew Petty commented on Facebook Post 2012-07-25 11:03:30 -0700 · Flag
I had the same problem. It has to do with caching on Facebook’s side of things. Take the page and run it through the Facebook Debugger here: http://developers.facebook.com/tools/debug

It fixes it right away.

Matthew Petty commented on Can slugs have slashes? 2012-07-20 11:36:47 -0700 · Flag
Woops, figured my characters would be escaped automatically… Here it is again:

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<