techbullion.com

Modern Development in WordPress with the Advanced Views Framework

By Noor Esa·Published August 7, 2024·Software

In today’s content-driven world, the quality of content displayed on your WordPress site is crucial. The Advanced Views Framework (AVF) is a specialized WordPress plugin designed to enhance content display and maximize functionality for WordPress sites. This framework simplifies high-quality development procedures and automates routine tasks, providing flexible solutions for both developers and website owners.

One of AVF’s main benefits is its flexibility, whether working with existing websites or new projects built from scratch. The plugin supports over 130 field types through five data vendors:

This high compatibility ensures seamless integration with various content types and data structures, allowing for customized and dynamic content presentations.

AVF includes powerful tools and adheres to modern web development best practices. These tools include Twig and Blade templates, and WebComponents, which are compatible with popular development tools like IDEs, Git, WP Interactivity API, and Tailwind CSS. These features speed up execution time and lead to the creation of fast, maintainable, and high-quality websites.

For those unfamiliar with the top three WordPress Meta Field plugins, here’s a quick comparison:

Available Versions

AVF is available in two versions: Lite and Pro. Both share core features that simplify querying and displaying content within a WordPress site, but the Pro version includes additional advanced features and third-party integrations.

Lite

Advanced Views Lite edition can be installed from the WordPress directory, providing basic tools to improve content rendering and simplify template creation.

Pro

Advanced Views Pro edition offers advanced features such as multi-level field and query support (e.g., Repeaters) and a smart bridge to build Gutenberg blocks. It’s ideal for complex projects requiring sophisticated content management and display solutions.

How to Install

To install the Lite version, search for “Advanced Views” in the WordPress plugin repository and click “Install Now.” To get the Pro version, purchase it from the official website at wplake.org/advanced-views-pro/ and upload it through the plugin upload interface on your WordPress site.

Key Aspects

Understanding the basics of AVF helps you utilize it fully. This framework is designed for both beginners and advanced developers due to its extensive functionality. Here are its key aspects:

View

In AVF, a “View” is a template for rendering content. You can create or edit views using popular templating languages like Twig or Blade. Views define how data is configured and displayed.

 Benefits: Automatic template generation and data conversion saves even more time with automated generation and conversion.

 Supported Data Vendors: Supports WordPress fields, WooCommerce, Advanced Custom Fields, and custom data.

Card

A “Card” is an entity for querying posts or other CPT items. Cards enable modular and consistently styled layouts that can be reproduced across different site sections.

You can get familiar with all the key aspects in the official Docs.

Integration Methods

AVF supports numerous field types from popular plugins and custom fields, making data import easy. Some integration methods include:

Examples of Usage

Here are some typical use cases for AVF:

Display ACF Gallery

The ACF Gallery field allows easy management of multiple images. You can add images from the WordPress Media Library or upload new ones. 

Installation Requirements:

Step-by-Step Guide:

Step 1: Creating a View

Step 2: Pasting the Shortcode

Troubleshooting:

Additional Features:

Display Custom Fields on a WooCommerce Product Page

Unfortunately, neither WooCommerce nor the ACF plugin provides a built-in method to display custom field values on the front end. In this way, some manual template customization is necessary. 

Step 1: Create an ACF View and Assign Your Fields

  1. Add a New View:
  1. Configure Your View:
  1. Tip: Use the row handle to reorder fields as needed.
  2. For Repeater Fields:
  1. Save Your View:
    • Click ‘Update’ to save your View.
    • Copy the generated shortcode.

Step 2: Insert the Shortcode into Your Product Template

  1. Modify WooCommerce Template Files:
  1. Edit the Theme File:
  1. Insert the Shortcode:
  1. View Your Product Page:
    Save your changes and visit your product page to see the result.

By following these steps, you can display custom ACF fields on your WooCommerce product pages without writing extensive PHP code. 

Display Custom Post Types and ACF Fields in WordPress

When you have posts, that’s fantastic. But what if you’re creating a business directory? Should each post represent a business or an article? And what if you also have a news section?

Using CPT allows us to solve the task properly. Let’s review how to display CPT items using Advanced Views on the ‘Company’ CPT example. 

Step 1: Create an ACF View

  1. Navigate to “Advanced Views”:

   In your WordPress admin dashboard, click on “Advanced Views” in the left sidebar.

   Click “Add New” to create a new ACF View.

  1. “Configure the ACF View:”
  1. “Assign Fields:”

   Tip: Use the row handle to reorder the fields as needed.

  1. Save the ACF View:

Step 2: Create an ACF Card

  1. Navigate to ACF Cards:
  1. Configure the ACF Card:

 

  1. Set Filters:

   Switch to the “Filters” tab.

   For “Post Type”, choose “Company” (or your custom post type name).

   Switch to the “Sort” tab, select “Title”, and choose “Ascending” for the sort order.

  1. Save and Publish the ACF Card:

Step 3: Create a Page to Display the List of Posts

  1. Add a New Page
  1. Insert the Shortcode:

Step 4: Add Company Posts

  1. Create Company Posts:

Step 5: View and Style the Output

  1. View the Page:
  1. Style the Output:

Step 6: Create a Responsive Layout

1 Responsive Layout Options:

  1. Advanced Filters (Optional)

Final Touches: Test the Setup

 

By following these steps, you can effectively display ACF fields in WooCommerce product templates using the Advanced Views framework, all without writing extensive PHP code. Enjoy the flexibility and ease of this powerful tool!

Conclusion

The Advanced Views Framework is a valuable tool for modern WordPress development, providing flexible and optimal solutions for content presentation. By supporting a wide range of field types and data sources and integrating with popular development tools, AVF streamlines the development process and enhances WordPress site capabilities. Whether creating a new site or improving an existing one, AVF’s features and flexibility ensure a top-notch end product.