Add Search to New Navigation Block

  • Hi, I have been enjoying the new 2.2 blocks for site headers. It is nice to have those customizer controls with the global styling.

    How can I add the search icon in the new nav block like in the customizer? And get the modal effect. Maybe this can be a toggle under the block’s configuration tab?

    Thanks

  • Hi there,

    Currently, there’s no option to add this directly from the block settings, but it’s a great idea — I’ll suggest it to the team.

    If you want to achieve this now, follow these steps:

    1. Make sure the Search Navigation Modal is enabled under Customize > Layout > Primary Navigation.

    2. Inside your Navigation block, add a Button block. This will act as the trigger for the search modal. You can style it to look like a search icon.

    3. Select the search button block, then in the block settings under Advanced > HTML Attributes, add:
    • Name: data-gpmodal-trigger
    • Value: gp-search

    That should activate the search modal when the button is clicked.

  • Works like a champ. Thank You!

  • You’re welcome!

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.