Blogging is a great strategy for B2B companies to reach their audiences and bring in more business. Sitecore makes creating and managing a blog easy. The Sitecore WeBlog module provides all the functionality needed to get a blog started: templates for the blog homepage and entry pages, categorization and tagging, an RSS feed, and social media share links. With the basic foundation in place, we can move on to customizing the look and feel of the blog, as well as the functionality.
One challenge with WeBlog is that it needs some custom work in order to make full use of Solr search. (It works better with Lucene, but we find it’s still best to add in some custom configurations to take advantage of better search functionality and get everything working smoothly.)
Implement Customizations to Optimize WeBlog with Solr
We recently implemented WeBlog for one of our B2B clients who uses Solr. To provide more functionality beyond what WeBlog offers out of the box, we undertook several key initiatves. We decided to:
- Implement custom search logic to populate the blog listing page using Solr search.
- Change the routing of the blog entries to allow pretty URLs.
- Style the blog to match the look and feel of the website.
- Use our custom search logic to implement keyword search and category filtering.
This is what we created:
As shown in the image above, we were able to support key business goals by implementing these features:
- A custom footer that encourages users to subscribe
- A custom header that focuses on easy blog navigation but provides a link back to the main website
- The ability to search within the blog and filter by category
- A featured blog post that is displayed prominently on the first page
- Social share links (available on the listing page as well as the blog posts themselves)
Modify Search Functionality Using Field Prioritization for More Accurate Results
When we initially worked on Kofax.com, the search engine was searching for keywords in a computed “content” field, which contained the aggregate of all of the text in the items’ fields and components, returning all results that contained the keyword in this field in no particular order.
Our client wanted the search engine to return results in a more logical order: first return results that contained the keyword in the title, then in the body text, then anywhere on the page. To satisfy this request, we implemented field boosting. Additionally, their search function makes it possible to filter results by content type, and to combine keyword searches with this filtering.
So, when we created the blog, we were able to use the search logic we had already written to customize search functionality; the keyword search returns results filtered by the Blog Entry content type, with results prioritized by relevance, and can be used in tandem with the blog category filters to search within a single category.
Create Search Engine Friendly URLs While Maintaining Sitecore Grouping Structure
In addition to optimized Search functionality, we knew that Kofax also wanted their blog post URLs to be more user-friendly. In WeBlog, when a content author creates a new blog entry, it automatically places it into a bucket for the current year and month (e.g. Blog > 2018 > November > Entry). Though this makes it easy to find entries in Sitecore, it also means that the URLs for the blog entries end up as “www.kofax.com/blog/2018/november/entry.”
Since Kofax wanted the URLs to be more user-friendly, (so as to simply be “/blog/entry”) and not include the year and month in the path, we added a custom item resolver to the request processor pipeline. The resolver checks if the requested path is a blog entry; if it is, it parses the blog entry name from the path, finds the item that has the same name, and (if found) sets the Context item to that item. This allows users to type in and link to pretty URLs (also known as Search Engine Friendly or SEF URLS), while maintaining the grouping structure in Sitecore.
The implementation of pretty URLs required an additional step to make the listing page link to the pretty URLs instead of the full URLs. The links for Sitecore items are generated with the Sitecore Link Provider. As with the Item Resolver, we created a custom Link Provider and added it to the Sitecore provider pipeline. If the current item is a blog entry item, our custom provider creates a URL with just the blog home path followed by the blog entry name.
Optimize the Functionality of a Corporate Blog to Serve Customers Better
Sitecore is a great platform for creating a blog, as it allows extensive customization of appearance and functionality. A blog can be created with or without the WeBlog module; however, the WeBlog module is a great jumping off point and provides a solid foundation from which to work. Custom code can be implemented to improve the search experience beyond out-of-the-box functionality regardless of which search engine is being used (Solr, Lucene, Coveo, etc.). By building a blog in Sitecore, we end up with easy creation and management of blog posts backed by a powerful platform with endless customization possibilities, allowing us to create a blog that’s unique in look and feel as well as performance.
Have you implemented WeBlog on your site? Share your thoughts and insights in the comments below or Tweet Us @Velir.