Archived topic
Adding a map at the top right side and an HTML text box
19 replies · Started by shlomo on December 21, 2021
I"d like to use a different side bar element (I'd like to add a map at the top right and another html box with text. Can you look into how we do it?
Hi there,
By "use a different sidebar element" do you mean you wish to change the sidebar contents of the site depending on a specific condition?
If yes, can you explain a bit more on what this specific condition? :D
I want to have a map in the sidebar only to this page: https://myrooff.com/find-a-roofer-in-mpg_citympg_state_name-zip-code-mpg_zip/
And so the rest will still have the category widgets and the calculator pages. Please let me know how this will be possible as I can't find any option to setup this one. Thanks, Elvin.
You can create a Block Element - Hook and add a map inside it.
You then set the hook dropdown to "before_right_sidebar_content" and set the display rule location to the page you want it to display on. :D
I'm not sure what is happening. On staging, it worked. But on the live site, it didn't. I tried to just set the location to all pages to somehow test if the hook is working if set to all pages, but it didn't as well.
Hi there,
can you share a link to a page where the map should appear - i couldn't get your previous URL to load...
That's supposedly the link that the map should appear. The link will be change according to the location of the user. I'm using a plugin called Multipage Plugin Generator. So I'm not sure if the hook is still able to detect the link generator to properly work.
Here's the actual link. https://myrooff.com/find-a-roofer-in-mpg_citympg_state_name-zip-code-mpg_zip/
But I still couldn't make the hook working even if I set the location of the sidebar to be visible into the entire website for some reason.
Not seeing anything in the sidebar apart from the widgets and a bunch of Advert placeholders.
If you have any server caching or CDNs can you try clearing those caches?
Hi there, David. Can you help me check what's wrong why it is not working on the main site please?
I'll attached a login info below for you to check.
NOTE: We are not updating our GeneratePress Theme to the latest version as it breaks our calculator.
So, if this is one of the possible reason, please do not make any changes yet as I need to spoke my developer first.
Thanks!
Hi there,
I've tried checking the link you've provided but I only get "OOPS! THAT PAGE CAN’T BE FOUND." which is basically an indication of a non-existing page or the url is incorrect. https://share.getcloudapp.com/nOu9gAlL
This issue affects the GP element because it isn't able to find the page to apply the element on.
You can try re-editing the permalink settings and save it and see if it finally works.
I wonder if you successfully logged in at the back end earlier. I attached a secure login credential.
The link I gave is a combination of shortcodes that is generated by a plugin called MultiPage Plugin Generator. This will generate a link according to a specific keyword and location of the user looking for roof contractors in the United States.
So, the hook element should be able to detect these changes on the link generated by MPG plugin. It has 38,000 combination of keyword links. Sure that this link: "https://myrooff.com/find-a-roofer-in-mpg_citympg_state_name-zip-code-mpg_zip/" will not be the link ever to be visible on the end-user.
One example of a link that a user will have is like this: https://myrooff.com/roofer-in-washtucna-wa-99371/
You can see a map at the bottom of this page. But that's not what I want. I want it to be on the sidebar. But only to these pages.
So each of these links should have a sidebar with a map. So, the only way that the map can be assigned to these 38,000 combination link is on the default link shortcode which is this one. "https://myrooff.com/find-a-roofer-in-mpg_citympg_state_name-zip-code-mpg_zip/"
Please let me know if the hook element can be able to recognize this auto-generated link. Is that possible with hook element? If not, is there any other way to put a sidebar to this MPG generated link other than hooking?
I hope I explained it properly. Thanks!
It could be that the Element Display Rules are having trouble with the auto-generated URLs.
One thing to test is to use a regular widget (Appearance > Widgets) along with a plugin like this to display the widget conditionally: https://wordpress.org/plugins/content-aware-sidebars/
Curious to know whether their conditions are able to handle the pages better.
Let us know :)
I tried the plugin you suggested, Tom. But it can't also find the target page. :(
What can you suggest?
You might need to contact the developers of that plugin and ask if there's a specific condition you need to use to target the pages their plugin creates.
With the condition we can add a simple filter to make an Element work with it.
Let us know :)
This is the response of the MPG plugin support.
"Hi Shlomo,
When you're creating a template you're choosing a page that you will use for all the pages generated:
https://vertis.d.pr/SuyFOP
It means that by controlling this page you also control all the generated pages.
You can assign any page there but let's check the one that you have currently assigned, it's this one: https://myrooff.com/wp-admin/post.php?post=6738&action=edit
With other themes like default WordPress themes you can easily choose a template for any page like this - https://vertis.d.pr/mWclvp
I don't see such an option in your WordPress instance so I recommend asking your theme developers whether there is such an option so then you can create a dedicated template and use the sidebar for that template only, that template you'll assign to this page that you're using as a template for MPG pages.
I hope it helps!"
No longer sure now if this can be possible.