Forum Replies Created

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter oranja

    (@oranja)

    you can set “text” fields on Lazy blocks as attributes so for example here is a JSON Lazy block that I have the “text” property is a text field that I set on my lazyblock:
    {
    “text”: “Get legal help for your not-for-profit organisation”,
    “backgroundCcolor”: “bg-green”,
    “button-text”: “Apply for free legal help”,
    “button-link”: “http://smaple”,
    “message”: “How can we help? “,
    “lazyblock”: {
    “slug”: “lazyblock/nfphero”
    },
    “align”: “”,
    “anchor”: “”,
    “blockId”: “Z2kVja1”,
    “blockUniqueClass”: “lazyblock-nfphero-Z2kVja1”,
    “ghostkitSpacings”: “”,
    “ghostkitSR”: “”
    }`

    i’m using WordPress as a headless CMS so this is what I got when I call Graphql.
    I have seen this article: https://webdevstudios.com/2021/02/09/wp-search-with-algolia/#indexing-custom-fields

    perhaps finding lazyblock custom types as it suggested in the article and getting meta could work ?

    Thread Starter oranja

    (@oranja)

    Not sure what they are striping out but I managed to export data of a lazy block props, if there was a way to index the Lazy block instance “controls” that will be awesome

    lazyblocks()->add_block( array(
            'id' => 4375,
            'title' => 'Download Card: File',
            'keywords' => array(
                0 => 'file',
                1 => 'download',
                2 => 'file size',
            ),
            'slug' => 'lazyblock/download-card-file',
            'description' => '',
            'category' => 'text',
            'category_label' => 'text',
            'supports' => array(
                'customClassName' => true,
                'anchor' => false,
                'align' => array(
                    0 => 'wide',
                    1 => 'full',
                ),
                'html' => false,
                'multiple' => true,
                'inserter' => true,
            ),
            'ghostkit' => array(
                'supports' => array(
                    'spacings' => false,
                    'display' => false,
                    'scrollReveal' => false,
                    'frame' => false,
                    'customCSS' => false,
                ),
            ),
            'controls' => array(
                'control_3b9a9f48eb' => array(
                    'type' => 'file',
                    'name' => 'file',
                    'default' => '',
                    'label' => 'file',
                    'help' => '',
                    'child_of' => '',
                    'placement' => 'content',
                    'width' => '100',
                    'hide_if_not_selected' => 'false',
                    'save_in_meta' => 'false',
                    'save_in_meta_name' => '',
                    'required' => 'false',
                    'allowed_mime_types' => array(
                    ),
                    'placeholder' => '',
                    'characters_limit' => '',
                ),
                'control_e2b9cd46c6' => array(
                    'type' => 'text',
                    'name' => 'size',
                    'default' => '',
                    'label' => 'size',
                    'help' => '',
                    'child_of' => '',
                    'placement' => 'content',
                    'width' => '100',
                    'hide_if_not_selected' => 'false',
                    'save_in_meta' => 'false',
                    'save_in_meta_name' => '',
                    'required' => 'false',
                    'placeholder' => '',
                    'characters_limit' => '',
                ),
            ),
            'code' => array(
                'output_method' => 'html',
                'editor_html' => '',
                'editor_callback' => '',
                'editor_css' => '',
                'frontend_html' => '',
                'frontend_callback' => '',
                'frontend_css' => '',
                'show_preview' => 'always',
                'single_output' => false,
            ),
            'condition' => array(
            ),
        ) );
    Thread Starter oranja

    (@oranja)

    Hi Michael,

    Thanks for looking into this so quickly.
    this is the plugin site: https://lazyblocks.com/ it is a free plugin.
    that’s the download plugin link: https://ww.wp.xz.cn/plugins/lazy-blocks/

    I don’t know if this is helping but looking at their docs I have noticed they have an option ta save a field value in the custom field: https://lazyblocks.com/documentation/blocks-controls/#custom-meta-field
    and also this: https://lazyblocks.com/documentation/examples/custom-post-type-and-save-in-meta-control/

Viewing 3 replies - 1 through 3 (of 3 total)