Blog Posts

Last Updated 5/7/2015
Blog Posts is part of the base content views. It allows you to publish blogs easily on your site.

Blog posts can be viewed by Author or By Topic.  

Topics

Blog Topics or Blog Names, if you like are a Category in Blog Posts. Be sure to add the topic for the blog before adding blog posts. Only Admins can add Category items (topics)

Authors

Blog Posts have a relationship to the Authors view. Add the post's author to the Authors view before creating the Blog Post.  Be sure to add the author's biography for the author's page on the website.

Add A New Blog Post


Add the Post


Be sure to fill in
1 Title

2 Written Date

3 Body

4 Author

5 Topic

On our demo site we will be including an 6 image and 7 summary for the blog listing page, so we fill in those too.

Creating Blogs on the Website

Blogs is made of 3 pages. You will want to create these three pages in your website.
  • Blogs - a listing of all of the blog postings by date. (friendly: blogs)
  • Blog Detail - the blog posting (friendly:blogdetail)
  • Authors Page - contains the author's biography and listing of the author's posts (friendly:author)

Blogs Page

We are going to build this page

Get the Lister
From the Blog Posts view access the Pick Fields dialog from the Action menu


On the Pick Fields dialog pick the fields you want on the Blogs page. We are going to pick Title, Written Date, Author First Name, Author Last Name, Summary, and Primary Image. Click Apply


The Blog Posts view should now look like this:


Now we can get the Lister code from Developer Info. From the Actions menu click on Developer Info.


In the Developer Info dialog go to the Sample List Helper and copy the code. 


Adding and Editing the Code
Now that we have the starter code, we can paste it into the Source for the Blog page we created earlier



This is a good start, but needs some editing to work.  If you published the page now and viewed it you would get an error. Let's fix the errors!

Checking for Authors and Displaying First Name and Last Name
Authors is a relationship to the Authors view. To get the Authors First Name and Last Name we need to access the Authors record. Here is code to access the Authors record


Display the Primary Image
The Lister gets the url to the primary image - now we need to put the url into an image tag. Also, we want the image to be a consistent size so we are going to specify the size in the url.


Format the Written Date
We want the Written Date to appear with the month and day so we need to check for the PubDate and then format it


Add links to Blog Detail 
The title of each post will link to the detail page for each post


Link to Author Page
We want the Author's name to link to the Author's page.


Time to Format the Page
We've got the basics, but we want the page to look good - so here's the final code after some formatting.

Blog Detail

We are going to build this page

Get the Detail Code
Repeat the steps above for Picking Fields above. This time make sure you get the Title, Written Date, Author First Name, Author Last Name, Body, and Primary Image.

In the Developer Info dialog go got the Sample Detail Helper and copy the code.



Adding and Editing the Code
Now that we have the starter code, we can paste it into the Source for the Blog Detail page we created earlier


Fix the Errors and Format the Page
Just like we did with the Blogs page, we need to fix the errors and format the data. Fix the author's name, primary image and format the written date. For the detail we also need to display the Body as HTML. Use the BRT.Raw helper to display HTML.


Here is the final code

Authors Page

We are going to build this page

Get the Sample Lister Code
Again we are going to repeat the steps above for Picking Fields above. This time make sure you get the Title, Written Date, Body, and Primary Image, Author First Name, Author Last Name, Author Biography, Author Primary Image. Also, this time filter the list for one of the Authors. You can pick any author, we will edit it later.

In the Developer Info dialog go to the Sample List Helper and copy the code.

Adding and Editing the Code
Add the started code to the Authors page.



Fix the Error and Format the Page
Once again we are going to fix the errors and start to format the page.  For now, format it just like we did for the Blog page. So here is what we have now:


Edit the Condition
We need to edit the Condition in our query to use the author's Id we passed in the URL. 


Add the Author's Section and Do Some Checking
Currently the author's image, name and bio are displayed with each story.  We want it to be displayed only one at the top of the page.  So, we are going to make sure it is only added once with the posts listed below. Here's the final code.



Listing By Topic
You know, that listing by author is really cool.  Can we do a list by topic too?

So glad you asked - yes we can.  Let's go back to the Blog page and add a list or topics we can link to. To do this we add the CategoryList helper



Update the Lister Condition
As you can see we are going to use the Blogs page to also list Blogs only by topic. To do that we need to check for a value in the topic query string and then update the Lister condition to search only for that topic.


Add a Title
If there is a topic we want the page to display the topic as page title. If there is no topic let's just use "Blogs" as our title.

Here's the Final Code

 

Want to learn more?

Call 800-924-5220 or

Schedule a demo