Open Off Canvas Element via a standard URL link

Hi, I would like to open an Off Canvas area element via a simple URL link instead of the toggle, I am limited by this within the plugin WPGoogleMaps Pro… the description editor does not allow me to add a shortcode as my first thought was adding it in there via a global block…

Any thoughts would be gratefully received… to clarify I can only use a standard link like this:

https://retirementsecurity-co-uk.stackstaging.com/map/#opentheoc

Thanks so much

Hello @wolfproductions,

Thanks for posting in!

Please do check this old thread to open the Off Canvas element with a link:

Kindly let us know how it goes.

Hi Ruenel, thanks but that won’t work unless the link is a link and not code.

Needs to be just domain.co.uk/#referencethattogglesoc

I need to trigger the OC areas with a simple reference like this: #openoc

Kindly had this reply from WP Pro Maps plugin dev:

Hi James,

Thank you so much for getting back to me.

So you won’t be able to use the existing link field for this as you cannot add a class or id, so my suggestion would be to add some html with an id such as a paragraph tag for example. Then using custom script, a JavaScript listener can be incorporated to listen for a click on that specific element ID which in turn can then trigger your modal.

Now with that said, I might suggest getting in touch with Cornerstone if they are generating the modal as they will likely know how this function is triggered and be able to incorporate some custom script to listen for this additional element.

This is what I would suggest, however, some plugins have specific functions for modals which they would then be aware of.

Hello @wolfproductions,

Regretfully you cannot trigger the Off Canvas area with a simple link. What you can only do is to open the Off Canvas with a link. Check out this video demo:

In my demo above, I have added the “Toggle Hash”:

With this, I can use #my-offcanvas as a link URL and be added to a button, menu item, or any link text on a page that will open the Off Canvas element.

Hope this makes sense.

It does and works perfectly… thanks so much

Hi @wolfproductions,

Glad that we are able to help you.

Thanks

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.