Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
contentSideBar.html.twig
<div class="sidebar-posts" xmlns="http://www.w3.org/1999/html">
<button class="dark-btn latest">Latest</button>
<button class="popular-posts active-btn">Most Popular</button>
<div class="shadowed">
<div class="post-scroll up"><div class="scroll-up-arrow"></div></div>
<ul class="gif-posts gif-sidebar">
{% for post in get_rail_posts('popular') %}
<li class="sidebar-popular">
<a href="{{ path('gif_site_post_view_by_slug', {slug: post.slug}) }}">
{{ resize_image(post, 98, 70, '', post.title, post.title) }}
<span class="gif-info"><p>{{ post.title }}</p></span>
</a>
<a href="{{ path('gif_site_landing', {'type': post.type | lower }) }}" class="post-type">{{ post.type }}</a>
</li>
{% endfor %}
{% for post in get_rail_posts('latest') %}
<li class="sidebar-latest" style="display:none;">
<a href="{{ path('gif_site_post_view_by_slug', {slug: post.slug}) }}">
{{ resize_image(post, 98, 70, '', post.title, post.title) }}
<span class="gif-info"><p>{{ post.title }}</p></span>
</a>
<a href="{{ path('gif_site_landing', {'type': post.type | lower }) }}" class="post-type">{{ post.type }}</a>
</li>
{% endfor %}
</ul>
<div class="post-scroll down"><div class="scroll-down-arrow"></div></div>
</div>
</div>
{% if type is not defined or type is defined and type == 'Freebies' %}
{% set contentSidebarAd = "" %}
{% endif %}
{#
this ad should be shown on everything that isn't a search page, post
view, welcome page, or one of the viral article pages (they have
their own sidebar entirely)
#}
{% if contentSidebarAd %}
<p class="advertisement" style='margin-bottom: -50px;'>Advertisement</p>
<div class="sidebar-google" style='margin-top: 50px; margin-bottom: 50px;'>
{% include "ZeetoGIFSiteBundle:Ads:async-adsense-ads.html.twig" with {'placement' : 'rail-2'} %}
</div>
{% set latestFbPost = get_social_feed('facebook') %}
{% if latestFbPost %}
<div class="sidebar-social-feed facebook-feed">
<i class="icon facebook header"></i><h3 class="header">Latest Post</h3>
<div class="relax"></div>
<span class="picture">
<a href="{{ latestFbPost.attachment.media[0].href }}" target="_blank"><img class="gif-lazy" src="" data-original="{{ latestFbPost.attachment.media[0].src | replace({'_s.': '_n.'}) }}" alt="WomenGetItFree on Facebook - {{ latestFbPost.message | truncate(30) }}" title="WomenGetItFree on Facebook - {{ latestFbPost.message | truncate(30) }}" /></a>
</span>
<span class="sub-header"><a href="https://facebook.com/WomenGetitfree" target="_blank">WOMEN GET IT FREE</a> {{ latestFbPost.created_time | time_ago }}</span>
<p>
{{ latestFbPost.message | parse_links }}
</p>
<span class="footer">
Want more? <a href="https://facebook.com/WomenGetitfree" target="_blank">Follow us</a>
</span>
</div>
{% endif %}
{% endif %}
{% set latestPin = get_social_feed('pinterest') %}
{% if latestPin %}
<div class="sidebar-social-feed pinterest-feed">
<i class="icon pinterest header"></i><h3 class="header">Latest Pin</h3>
<div class="relax"></div>
<span class="sub-header"><a href="https://pinterest.com/Getitfree/" target="_blank">GETITFREE</a> ONTO <a href="{{ latestPin.link }}">{{ latestPin.title | upper }}...</a></span>
<span class="picture">
<a href="{{ latestPin.link }}" target="_blank"><img class="gif-lazy" src="" data-original="{{ latestPin.picture }}" alt="{{ latestPin.title }}" title="{{ latestPin.title }}" /></a>
</span>
<p>
{{ latestPin.description | parse_links }}
</p>
<span class="footer">
Want more? <a href="https://pinterest.com/Getitfree/" target="_blank">Follow us</a>
</span>
</div>
{% endif %}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.