LocalSignal Blog are specific to each Web Capsule. Developers have the ability of creating multiple blogs per capsule. The blog posts are stored at the web capsule level.
In order to style/ show blog information you are required to code the page template located in the sitemap. LocalSignal uses liquid code to display template information.
LocalSignal Blogs use Liquid to display blog content in the Blog Index Page and Blog Posts. Liquid code can also be used to display Blog information outside of the Blog area.
Liquid Code | Notes |
---|---|
{{post.url}} | Outputs the URL of the current post |
{{post.title}} | Outputs the post title |
{{post.content}} | Outputs the URL of the current post |
{{post.content_preview}} | First 600 characters of the post content |
{{post.feature_image_url}} | Featured image |
{{post.feature_image_thumbnail_url}} | Featured image thumbnail |
{% if post.feature_image_present == true %} {% endif %} | Check for feature image |
{% if post.feature_image_thumbnail_ present == true %} {% endif %} | Check for thumbnail |
{{post.author_name}} | Outputs author name |
{{post.author_bio}} | Outputs author biography |
{{post.published_at}} | Published at date and time for post |
1
2
3
{% if post.feature_image_thumbnail_present == true %}
<img src="{{post.feature_image_thumbnail_url}}" alt="feature image" />
{% endif %}
1
<p>{{post.published_at | date: “%a, %b %d, %y”}}</p>
1
2
3
<a href="/{{post.url}}">
<strong>{{post.title}}</strong>
</a>
The Blog Index page using specific liquid code to display all of the posts listed.
Code | Notes |
---|---|
{{post.title}} | Outputs post title |
{{post.author_name}} | Outputs post author name |
{{post.published_at | date: "%B %-d, %Y"}} | Outputs post published date in format listed |
{{post.content}} | Outputs post content |
1
2
3
4
5
6
7
8
9
10
11
<div class="p-blog p-blog-post p-padding">
<div class="container">
<div class="col-xs-12">
<img class="feature-img" src="{{post.feature_image_url}}" alt="{{post.title}}">
<h1>{{post.title}}</h1>
<p>{{post.author_name}}</p>
<p>{{ post.published_at | date: "%B %-d, %Y" }}</p>
<div>{{post.content}}</div>
</div>
</div>
</div>
The Blog Index page using specific liqiud code to display all of the posts listed.
Liquid Code | Notes |
---|---|
{% for post in posts.list %} {% endfor %} | Outputs all of the posts in a blog. This code is used for the Blog Index Page |
1
2
3
{% for post in posts.list %}
<a href="/{{post.url}}">{{post.title}}</a>
{% endfor %}
1
2
3
4
5
6
7
8
9
<div class="text-center">
<ul class="pagination">
{% for page in posts.pagination %}
<li class="{% if posts.current_page == page[0]%}active{% endif %}">
<a href="{{page[1]}}">{{page[0]}}</a>
</li>
{% endfor %}
</ul>
</div>
This blog code allows users to display and access blog posts throughout the web capsule.
Code | Notes |
---|---|
{% for post in blogs.ref_id.posts %}{% endfor %} | Outputs information from the blog tied to the chosen reference id. |
{% for post in blogs.blog_name.posts %}{% endfor %} | Outputs information from the blog specified |
{% for post in blogs.news.posts %}{% endfor %} | Outputs information from the news blog |
1
2
3
4
5
{% for post in blogs.blog_name.posts %}
<h3>{{post.title}}</h3>
<p>{{ post.published_at | date: "%B %-d, %Y" }}</p>
<div>{{post.content}}</div>
{% endfor %}