• Hi Takashi,

    I’d love to use “My Favorites” with Gridbuilder WP, a plugin that lets you build advanced grid layouts with real time faceted search.

    You can see it in action below:
    https://demos.wpgridbuilder.com/ (WooCommerce demo)
    https://demos.wpgridbuilder.com/blog/ (blog demo)
    https://demos.wpgridbuilder.com/map/ (map demo)

    What I’d like to do is to offer the option to the user:
    1. to add posts (or articles with WooCmommerce, or locations with the map) to their favorites by clicking on an icon (heart, star or similar) from the grid itself
    2. AND to only show their favorites within the Gridbuilder grid (while applying or not applying additional filters from Gridbuilder itself).

    Do you think you could make it happen?
    Here is the documentation for developers about PHP Functions, Filters, Actions as well as JS Events and Methods => https://docs.wpgridbuilder.com/

    Best,

    Laurent

Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Author Takashi Matsuyama

    (@takashimatsuyama)

    Hello @lfalipou ,

    Thank you for your question.

    Unfortunately, I have not used this plugin with them, so I am not sure about compatibility.
    If you can add this plugin shortcode to them it might work.
    Sorry for the uncertain answer, but if you get a chance, please test them.

    Thanks

    Thread Starter laurentfa

    (@lfalipou)

    Thank you Takashi (@takashimatsuyama).

    Here is what Loic (the developer of Gridbuilder) just told me:

    If the plugin has a shortcode, it is possible to add it in a raw content block. In this case the shortcode must also accept the ID of the article as an attribute in order to render the correct content. In this case, there is no need for special integration.

    Does his reply make you feel like I could do exactly what I want without needing a special integration between the two plugins?

    I asked him to clarify a few things and will add to my reply if he gets back to me.

    Best,

    Laurent

    Thread Starter laurentfa

    (@lfalipou)

    Hi Takashi. Here is the last reply of the dev Lo?c:

    In the card builder of Gridbuilder, you can add shortcodes in a raw content block (HTML).
    To render a shortcode it has to accept as attribute the ID of the post (of the article, product, etc.).
    However, filtering this will certainly not be possible because the data is dynamic, depending on the user.

    Thread Starter laurentfa

    (@lfalipou)

    I think the problem could be circumvented by creating on another archive page a gallery of posts displaying only the cards of the bookmarked posts?

    Could I do so using My Favorites with a site builder such as Oxygen or Bricks wich have a repeater element? See Oxygen for example: :https://oxygenbuilder.com/documentation/builder-elements/repeater/

    Otherwise, do you see another way of doing it?

    Thanks a lot @takashimatsuyama.

    • This reply was modified 2 years, 8 months ago by laurentfa.
    Plugin Author Takashi Matsuyama

    (@takashimatsuyama)

    Hello @lfalipou ,

    Thank you for your question.

    Unfortunately, however, I am not a user of those site builders and have no knowledge of their specifications or compatibility.

    I have also read the documentation collection and developer opinions, but in the end, I can’t determine compatibility until I actually implement it and see how it works.

    If they can add WordPress shortcodes, then maybe you can use this plugin.

    If those site builders have a test environment that does not affect the site being published, I think one solution would be to try this plugin to see if it works.

    Thanks

    Hi @lfalipou, @takashimatsuyama,

    I had the exact same requirement and solved it by adding the following to functions.php, it will add a custom block to gridbuilder allowing you to add favourites to your card:

    add_filter( ‘wp_grid_builder/blocks’, ‘wpdd_register_favourite_block’, 10, 1 );
    function wpdd_register_favourite_block( $blocks ) {

    // ‘acf_image_block’ corresponds to the block slug.
    $blocks[‘acf_favourite_block’] = [
    ‘name’ => __( ‘My Favourite’, ‘text-domain’ ),
    ‘render_callback’ => ‘wpdd_favourite_block_render’,
    ];

    return $blocks;

    }

    // The render callback function allows to output content in cards.
    function wpdd_favourite_block_render() {

    // access the global $post variable
    global $post;

    // get current post, term, or user object
    $post = wpgb_get_post();

    // sets up global post data
    setup_postdata( $post );

    // print formatted string in the desired HTML markup

    printf( do_shortcode(‘[ccc_my_favorite_select_button post_id=”‘.get_the_ID().'” style=””]’));

    // restore the $post global to the current post in the main query
    wp_reset_postdata();

    }

    Thread Starter laurentfa

    (@lfalipou)

    Thanks alot @johann101 for taking the time to share your solution with us, I’ll try your code when I have the opportunity to do it.

    Best!

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Compatibility with Gridbuilder WP and other site builders’ is closed to new replies.