website logo
⌘K
Introduction
PORTAL
Agency Whitelabelling
PAGES
Pages - Accessing Page Data
Pagination Layouts
Page Templates
FORMS
CATEGORIES
Filtering WebApps and Modules by Categories
Outputting Categories on WebApp / Module / eCommerce Layouts
Outputting Category Fields in any Location
Category Detail Layouts
FAQ - Categories
COMPANY INFORMATION
Company Information
SITE SEARCH
Site Search
PUBLIC API/ZAPIER
Zapier - Formatting arrays correctly
Public API/Zapier Changelog
MODULES
Module Marketplace
Building Custom Modules
Siteglide Modules
Front-end Submit Modules
DATA STRUCTURES
Creating WebApps from the CLI
Field Types
WEBAPPS
Front-end Submit WebApps
Layouts
Search and Filtering
Understanding Custom Field Names and IDs
FAQ - WebApps
CRM
User Details
User Secure Zones
Storing User's Favourite WebApp / Module Items
User's Form Submissions (Cases)
How Users Edit their Email and Password Front End
Editing a User's CRM record Front End with Custom Field Sets
CLI
Introducing Siteglide CLI
CLI Changelog
Secure Zones with CLI
Page Templates with Siteglide CLI
Pages with Siteglide CLI
Includes with Siteglide CLI
Managing Email Templates
Migrate - Manual Form setup
Migrate - Convert existing Forms
Liquid
Accessing Assets
Liquid Dot Notation
Using WebApp Collections- Tutorial
Using the current_user object with Secure Zones
Preventing Duplicate Content with Query Parameters- Canonical URL and Robots.txt
FAQ - Liquid
GraphQL
Tutorial Overview
About GraphQL
Tutorial 1- Your First Query
Tutorial 2 - Pagination
Tutorial 3 - Filtering the Results
Tutorial 3 - Answers to the First Filtering Challenge
Tutorial 4 - Advanced Filtering
Tutorial 4 - Challenge Answers
Tutorial 5 - Using Liquid to run GraphQL queries on your Site
Tutorial 6 - Variables
Tutorial 6 - Answers to the Variables Challenge
Tutorial 7 - Sorting
Tutorial 8 - Building a Liquid API GET Endpoint Page powered by GraphQL queries
Best Practice and Performance
Module/WebApp Caching
Getting Started with Liquid Caching - to Reduce Server Response time and Improve Performance
Includes
ecommerce/checkout_standard
Frequently Asked Questions
Using Liquid Logic to Check if a field exists, or is empty on the Front End
How do I learn more about Liquid?
How to setup a multi domain start page
Docs powered by archbee 

Browse by Author

11min

Combining the Blog and Author Modules allows you to filter the Blog posts by a specific Author's posts.

Document image


Introduction

This article explains:

  • How to include the Browse by Author Option when including a Blog List
  • Default Layout Examples
  • How to give feedback to the User about their results e.g. in the screenshot "Posts by Regina Alexander"

Add "use_adv_search" parameter to include for Blog List View

The "use_adv_search" parameter is needed to allow filtering from the URL to apply to your Blog Posts, this can be added to the include for Blog List like so:

HTML
|
{%- include 'module' 
    id: '3'
    layout: 'default'
    per_page: '20'
    show_pagination: 'true'
    sort_type: 'created_at'
    sort_order: 'desc'
    use_adv_search: 'true' 
-%}


To Include this Option

Include the following liquid to dynamically get a list of available Blog Authors for the User to select.

HTML
|
{%- include 'modules/siteglide_authors/get/get_authors'
    author_layout: 'default/author'
    author_layout_type: 'sidebar'
    author_field: 'module_field_3_4' 
-%}


The author_field will be module_field_3_4 if you are using Siteglide's Authors Module. The layouts are structured in the same way as Category Layouts in the previous section.

Default Layout Examples with Explanation

wrapper.liquid

HTML
|
<div class="row no-gutters">
  <div class="col-12">
    <h2>Authors</h2>
    <ul>
      {%- include 'modules/siteglide_system/get/get_items', item_layout: 'item' -%}
    </ul>
  </div>
</div>


item.liquid

HTML
|
<a class="authorAnchorSidebar" href="{{context.location.pathname}}?module_field_3_4={{this.id}}&author_name={{this.name | url_encode}}">
  {% if this['Image'] -%}
    <img src="{% if this['Image'] contains 'http' -%}{{this['Image']}}{% else -%}{{this['Image'] | asset_url}}{% endif -%}" alt="{{this['Image Alt']}}">
  {% endif -%}
  <li>{{this['name']}}</li>
</a>


To filter the Blog List View, you need a link to the Blog List View slug, followed by "?module_field_3_4={{this.id}}". Siteglide will be able to read the URL and filter the list.

User Feedback

To make it easier to give feedback to the User, you can optionally include the Author's name in the url:

HTML
|
href="{{context.location.pathname}}?module_field_3_4={{this.id}}&author_name={{this.name | url_encode}}"


On the List view, you can then include the following liquid to read the URL and decode the Author name you are currently filtering by:

HTML
|
{% elsif context.params.module_field_3_4 %}
  Posts by {{context.params.author_name | url_decode}}
{% endif %}


Updated 03 Mar 2023
Did this page help you?
Yes
No
PREVIOUS
Browse By Category
NEXT
eCommerce
Docs powered by archbee 
TABLE OF CONTENTS
Introduction
Add "use_adv_search" parameter to include for Blog List View
To Include this Option
Default Layout Examples with Explanation
wrapper.liquid
item.liquid
User Feedback