Getting started with blogs

Last Updated: May 09, 2017 02:05PM PDT
Please check LiveWhale Docs for the latest information.
In essence, a LiveWhale blog is a collection of chronological posts, with a few special features:

Custom Fields

By default, all blog posts have:
  • title field
  • body field (WYSIWYG, can include text, images, embedded media)
  • image
  • date
You can add custom fields to your blog (e.g., current mood, current city, video URL, phone number, or any other) and they will be available in each blog post. You can set custom fields as required, if you like.

Comments

You can enable Disqus comments enabled site-wide, or use a custom Disqus setup unique to your blog. Learn more about setting up Disqus comments on your blog.

Contributors and Moderators

You have the option to hand-pick contributors (allowed to post) and moderators (must approve any post) from any LiveWhale group. If you don’t set contributors, any editor from your group will be able to add/edit posts in your blog. If you don’t set any moderators, than editors/contributors can publish their own posts.

Displaying Your Blog

Once your blog is created and has a few posts, you’ll use a widget to display it on any page you like. Go to Widgets > Add a new widget and select “Blogs” as the widget type. Under the basic options, choose your blog’s name in the “Only display posts from blog(s):” field.

For the widget format, you can choose any fields you like to display. The following is a basic starter format, which shows the date, title, image, and a summary for each post, along with a link to the full entry: 
<div class="lw_blogs_title">{date}: {title}</div>
<span class="lw_blogs_image">{image}</span>
<div class="lw_blogs_summary">{summary}</div>
<a href="{href}">Read more...</a>
 
Or, you can show the full text of each blog post in the widget: 
<div class="lw_blogs_title">{date}: {title}</div>
<span class="lw_blogs_image">{image}</span>
<div class="lw_blogs_summary">{post}</div>

Save your widget and drop it into any page: that’s it! Your blog is now publicly visible.

Creating a Blog Post Details Template

Just like with a news story, LiveWhale needs a details template to display individual blog posts. By default, LiveWhale will look for /_ingredients/templates/details/blogs.php for this file, though you can set your own file path in your site-wide config file.

Near the top of your blogs.php template, make sure to include <widget type=”blogs_details” priority=”high”/>
You can use the following XPHP variables to setup your details template. (Note: 90% of the variables for blogs will match what you already have in your profiles.php template.)
XPHP Variable XPHP Variable’s Description 
<xphp var=”details_title”/> Displays the title of your blog post.
<xphp var=”details_post”/> Displays the contents of your blog post.
<xphp var=”details_date”/> Displays the date of your blog post.
<xphp var=”details_image”/> Displays the image attached to your blog post.
<xphp var=”details_body”/> Displays all custom fields assigned to “body” in your blog setup. 
<xphp var=”details_sidebar”/> Displays all custom fields assigned to “sidebar” in your blog setup.
<xphp var=”blogs_###”/> Displays the contents of a custom field (i.e., blogs_2).

Tip
: Since LiveWhale uses the same blogs.php details template for all your blogs, it’s a good idea to include some XPHP conditional logic when displaying custom fields, since different blogs will have different custom fields.
<xphp content="true">
<if var="blogs_10"/>
    <content>
        <!-- there is content in the blogs_10 custom field -->
        My custom field: <xphp var="blogs_10"/>
    </content>
</xphp>

Email support@livewhale.com and we’ll be happy to help.