• Hello
    I am strugling for 2 days now to do a simple thing : Adding a search form on my home page (within the content-not the sidebars, footers etc.)

    I was wondering if this is a limitation of this plugin as inserting the search form as a block (which is a basic feature) is not possible (for me).

    I do not want to use any page builder. I am using kadence theme with kadence blocks.
    I have minimum plugins installed

    Here the list of installed plugins

    +--------------------+----------+--------+---------+
    | name               | status   | update | version |
    +--------------------+----------+--------+---------+
    | akismet            | inactive | none   | 5.1     |
    | kadence-blocks-pro | active   | none   | 1.7.29  |
    | kadence-blocks     | active   | none   | 3.0.41  |
    | loco-translate     | active   | none   | 2.6.4   |
    | nginx-helper       | active   | none   | 2.2.3   |
    | vikbooking         | active   | none   | 1.6.2   |
    +--------------------+----------+--------+---------+
    

    Here is the theme used :

    +-------------------+----------+--------+---------+
    | name              | status   | update | version |
    +-------------------+----------+--------+---------+
    | kadence           | active   | none   | 1.1.40  |
    | twentytwentyone   | inactive | none   | 1.8     |
    | twentytwentythree | inactive | none   | 1.1     |
    | twentytwentytwo   | inactive | none   | 1.4     |
    +-------------------+----------+--------+---------+
    

    Here is the list of sidebars:

    +--------------------+---------------------+--------------------------------------------------------------------------------------------+
    | name               | id                  | description                                                                                |
    +--------------------+---------------------+--------------------------------------------------------------------------------------------+
    | Sidebar 1          | sidebar-primary     | Add widgets here.                                                                          |
    | Sidebar 2          | sidebar-secondary   | Add widgets here.                                                                          |
    | Footer 1           | footer1             | Add widgets here.                                                                          |
    | Footer 2           | footer2             | Add widgets here.                                                                          |
    | Footer 3           | footer3             | Add widgets here.                                                                          |
    | Footer 4           | footer4             | Add widgets here.                                                                          |
    | Footer 5           | footer5             | Add widgets here.                                                                          |
    | Footer 6           | footer6             | Add widgets here.                                                                          |
    | Widgets désactivés | wp_inactive_widgets | Glissez ici les widgets que vous voulez retirer de la colonne latérale, tout en conservant |
    |                    |                     |  leurs réglages actuels.                                                                   |
    +--------------------+---------------------+--------------------------------------------------------------------------------------------+

    What i want to achieve is illustrated here as a video :
    https://screencast-o-matic.com/watch/c01I64VByDQ

    It can be summirized as follow :
    Tried to add the search for as a widget on sidebar (and made the sidebar appear on homepage) and the form works perfectly. The problem is that i do not want to have the sidebar appearing on this page (for ux ui design purposes).

    I have tried to copy the search block from the widget area and paste the block within my content (homepage). It appears but js errors are reported in the console and the form iss not functioning correctly.

    I have tried to install few plugins that allow to use widgets created within the gutenberg editor as blocks…i had the same issue.

    I just wanted to save some time and i would be very greateful if you could tell me if inserting the search form as a gutenberg block is not possible at the moment with vikbooking, so i can stop keep trying and look for an alternative until the issue is solved.

    Thanks a lot in advance for your time and work.

Viewing 1 replies (of 1 total)
  • Plugin Author e4jvikwp

    (@e4jvikwp)

    Hello,

    Thanks for the extremely detailed report of your situation. It’s all clear, and what we can tell you is that as of today (June 2023) the widgets are not available as blocks in any of our plugins. We would like to explain the situation better:

    VikBooking does generate blocks for the FSE (Full Site Editing) functions, it actually declares just one block to pick one of the pre-configured Shortcodes. However, widgets are not blocks at the moment, and our programmers will have to implement an efficient way to keep the so called “legacy widgets” (for those themes using sidebars and for any page builder plugin) as well as to provide them as blocks without having to maintain duplicate code. We haven’t scheduled the development for this major framework implementation yet, but once this will be available, we will adopt it on all our plugins.

    We understand you don’t want to use any page-builder plugin, which would be capable of rendering a widget inside the content of a page just like what you’re trying to achieve, and what we can suggest in this case is to find an alternative solution to perform the same exact operation that any page-builder plugin does, which is rendering a widget through the WordPress native function the_widget() (official documentation is available at https://developer.www.ads-software.com/reference/functions/the_widget/). Our widgets have got a few settings as you’ve noticed when adding a widget to a Sidebar, and those settings should be passed exactly through the second argument of the WordPress native function the_widget(). It’s probably a complex operation and it’s something hard to be maintained, but that’s what any page-builder plugin does.

    There should be some free plugins capable of rendering a widget inside a content/block with their own parameters, but for sure you cannot use the “copy-block” feature because as you’ve noticed, that serves as a way to copy the whole HTML code generated by our widget and to paste it onto another block of the page. It is technically impossible for this technique to work because our widgets have been designed to support unlimited instances on the same page, and so they use random and progressive values to declare specific JavaScript functions. This explains why copying the block generated all those JavaScript errors. It’s because the process copied a source code that will never exist again when the page is loaded. Also, that would be static content with always the same HTML and JS code, and so the copy-block function will never work.

    Lastly, we strongly discourage to use Shortcodes in the home page in favor of rather using the widgets. This is because widgets can take the landing page URL (the form action) from the apposite “Page” parameter, and so this means that the booking process can be properly routed. Instead, if you were to publish a Shortcode in your home page, then the routing functions won’t be started, because the home page is a special page with no permalink. That’s why we suggest using Shortcodes on any page of your website except the home page, and that’s why it would be good for you to find a way to publish the “Search Form” widget of Vik Booking in your home page.

    We hope you will find our answer satisfactory. Thank you,

    The VikWP Team

Viewing 1 replies (of 1 total)
  • The topic ‘Search form and gutenberg blocks’ is closed to new replies.