Dynamic Objects—dynamic_objects.php

Introduction

In the Venddor IO block manager framework, dynamic objects refer to entities that can showcase varied content and states for blocks on their detailed pages.

By default, there are five core dynamic objects: Products, Pages, Categories, Vendors, and News. It's important to note that Vendors are a feature exclusive to the stores that uses the Seller Center of Venddor.

Understanding the Significance of Dynamic Objects

To comprehend the value and utility of dynamic objects, consider the 'Products' object as a case study. The behavior remains consistent across all dynamic objects.

When adjustments are made to a block's content on a product's editing page, such modifications are confined to that specific product. Whenever block content undergoes changes, a reference indicating where alterations were made appears below. Additionally, an option is available to apply these changes universally across all products.

Similarly, if a block's visibility is toggled on/off on a product's editing page, such a state is preserved solely for the concerned product.

Within the block manager, when tweaking any block at a location tagged with dispatch=products.view, there's an opportunity to leverage the Status tab. This enables users to activate or deactivate a block for chosen products, regardless of its universal status.

In Conclusion

Dynamic objects in Venddor IO are a testament to the platform's flexible content management capabilities. They ensure that individual entities, like products or categories, have custom content displays, allowing for a tailored user experience. The ability to have both global and specific settings offers businesses a nuanced approach to content presentation.

The Mechanics of Dynamic Objects in Venddor IO's Block Manager

In Venddor IO's Block Manager, dynamic objects offer an efficient way to manage and present varied content based on specific criteria. When you establish a dynamic object by defining it within dynamic_objects.php, the system intuitively sets up the object for you. Let's delve into how a product, as a dynamic object, operates within this system:

Consider the representation of 'products' as a dynamic object:

array(
    // The identifier for the dynamic object, in this case, 'products'.
    'products' => array (
        // This defines the admin page where the object is edited, allowing for the "Block" tabs to be visible in the admin interface.
        'admin_dispatch' => 'products.update',
        // This indicates the user-side address where the dynamic object operates, and also serves as the control pane for block adjustments.
        'customer_dispatch' => 'products.view',
        // A specific key within the $_REQUEST array that pinpoints the unique ID of the object.
        'key' => 'product_id',
        // Configuration for the picker tool utilized within the store's admin area.
        'picker' => 'pickers/products/picker.tpl',
        'picker_params' => array (
            'type' => 'links',
        ),
    ),
)

Whenever a user accesses a page with a dispatch=products.view parameter, Venddor IO recognizes it as linked to the 'products' dynamic object. The system then searches for a product_id among the script's passed parameters. If a product_id is identified, all pertinent data to render the page is sourced via the blocks API using the specified type and ID.

However, in cases where either the key parameter is absent or the block type isn't discernible from the dispatch, the system generates data using global settings, bypassing the dynamic object.