< Back

Sample Post One

14 April 2019

Categories: Blog: News & Events   Tags: blog posts   demo   sample  
Sample Post One

Orci phasellus egestas tellus rutrum tellus pellentesque. Sed enim ut sem viverra aliquet. Sed euismod nisi porta lorem mollis aliquam ut porttitor. Eget duis at tellus at urna condimentum mattis pellentesque. A condimentum vitae sapien pellentesque habitant morbi tristique senectus et. Viverra aliquet eget sit amet tellus cras adipiscing enim.

Non tellus orci ac auctor augue mauris. In hendrerit gravida rutrum quisque non. Morbi tempus iaculis urna id volutpat lacus laoreet. Nulla aliquet enim tortor at. Erat velit scelerisque in dictum non. Neque gravida in fermentum et sollicitudin ac orci phasellus. Luctus venenatis lectus magna fringilla urna porttitor. Lorem sed risus ultricies tristique nulla aliquet. Non consectetur a erat nam.

Fames ac turpis egestas maecenas. Nibh sit amet commodo nulla facilisi. Id eu nisl nunc mi ipsum faucibus vitae aliquet. Quis viverra nibh cras pulvinar. Enim nulla aliquet porttitor lacus luctus accumsan tortor posuere ac. Orci eu lobortis elementum nibh tellus molestie nunc. Ut sem nulla pharetra diam sit amet. Massa vitae tortor condimentum lacinia quis vel eros.

Sodales ut eu sem integer vitae justo eget. At risus viverra adipiscing at in tellus integer. Ac odio tempor orci dapibus ultrices. Diam ut venenatis tellus in metus vulputate eu scelerisque felis. Commodo ullamcorper a lacus vestibulum.

This is a description for my blog.
It has Categories and Tags applied and can be filtered by Category, Tag and Month.
Pagination is also enabled.


All Categories

All Tags

By Month

Code: (Post Detail Layout)

{% component source: "Blog", layout: "", filterBy: "id", filterValue: "{{this.parentId}}", limit: "1", collectionVariable: "parentBlog", type: "module" %}
{% component source: "Blog Post", layout: "", sortBy: "releaseDate", sortOrder: "DESC", limit: "1000", collectionVariable: "allPosts", type: "module" %}

<div>
    <hr>
    <div class="grid-x grid-padding-x">
        <div class="cell medium-8">
<!-- BLOG POST DETAIL -->
            <p><a href="{{this.url | remove: this.urlslug}}" style="font-size: 1.4rem;">&lt; Back</a></p>
            <h2>{{this['Name']}}</h2>
            <p><small>{{this.releasedate | date: "%e %B %Y"}}</small></p>
            {% if this.itemcategories[0] != null %}Categories:
                {% for c in this.itemcategories %}
                <span class="label secondary">
                    <a href="{{this.url | remove: this.urlslug}}?cat={{c | url_encode}}" style="color:white;">
                        {{c}}
                    </a>
                </span>&nbsp;
                {% endfor %}
            {% endif %}
            {% if this.itemtags[0] != null %}Tags:
                {% for t in this.itemtags %}
                <span class="label secondary">
                    <a href="{{this.url | remove: this.urlslug}}?tag={{t | url_encode}}" style="color:white;">
                        {{t}}
                    </a>
                </span>&nbsp;
                {% endfor %}
            {% endif %}
            <hr>
            <img src="{{this['Image']}}?width=1200" alt="{{this['Name']}}">
            <hr>
            {{this['Description']}}
<!-- /END BLOG POST DETAIL -->
        </div>
        <div class="cell medium-4">
            <p class="lead">{{parentBlog.items[0]['Description']}}</p>
            <hr>
            <h5>All Categories</h5>
            {% for i in allPosts.items %}
                {% if i.parentid == this.parentid %}
                    {% for ii in i.itemcategories %}
                        {% assign catArray = catArray | append: ii | append: ',' %}
                    {% endfor %}
                {% endif %}
            {% endfor %}
            {% assign cats = catArray | split: ',' | uniq | sort %}
            <ul class="menu vertical">
                {% for c in cats %}
                    {% assign catNum = 0 -%}
                    {% assign catLink = c | url_encode | prepend: '?cat=' | prepend: this.url | remove: this.urlslug %}
                    {% for n in allPosts.items %}
                        {% if n.itemcategories contains c %}
                            {% assign catNum = catNum | plus: 1 -%}
                        {% endif %}
                    {% endfor %}
                    <li {% if filterValue == c %}class="is-active"{% endif %}>
                        <a href="{{catLink}}">
                            {{c}} ({{catNum}})
                        </a>
                    </li>
                {% endfor %}
            </ul>
            <hr>
            <h5>All Tags</h5>
            {% for i in allPosts.items %}
                {% if i.parentid == this.parentid %}
                    {% for ii in i.itemtags %}
                        {% assign tagArray = tagArray | append: ii | append: ',' %}
                    {% endfor %}
                {% endif %}
            {% endfor %}
            {% assign tags = tagArray | split: ',' | uniq | sort %}
            <ul class="menu vertical">
                {% for t in tags %}
                    {% assign tagNum = 0 -%}
                    {% assign tagLink = t | url_encode | prepend: '?tag=' | prepend: this.url | remove: this.urlslug %}
                    {% for n in allPosts.items %}
                        {% if n.itemtags contains t %}
                            {% assign tagNum = tagNum | plus: 1 -%}
                        {% endif %}
                    {% endfor %}
                    <li {% if filterValue == t %}class="is-active"{% endif %}>
                        <a href="{{tagLink}}">
                            {{t}} ({{tagNum}})
                        </a>
                    </li>
                {% endfor %}
            </ul>
            <hr>
            <h5>By Month</h5>
            {% for i in allPosts.items %}
                {% if i.parentid == this.parentid %}
                    {% assign dateFilterFormat = i.releasedate | date: '%Y-%m' %}
                    {% assign dateArray = dateArray | append: dateFilterFormat | append: ',' %}
                {% endif %}
            {% endfor %}
            {% assign dates = dateArray | split: ',' | uniq | sort | reverse %}
            <ul class="menu vertical">
                {% for d in dates %}
                    {% assign dateNum = 0 -%}
                    {% assign dateLink = d | url_encode | prepend: '?date=' | prepend: this.url | remove: this.urlslug %}
                    {% assign dateDisplayFormat = d | date: '%B %Y' %}
                    {% for n in allPosts.items %}
                        {% if n.releasedate | date: "%Y-%m" contains d %}
                            {% assign dateNum = dateNum | plus: 1 -%}
                        {% endif %}
                    {% endfor %}
                    <li {% if filterValue == d %}class="is-active"{% endif %}>
                        <a href="{{dateLink}}">
                            {{dateDisplayFormat}} ({{dateNum}})
                        </a>
                    </li>
                {% endfor %}
            </ul>
        </div>
    </div>
</div>