How to Add a Fixed Map Toggle to Your Divi Page Template

How to Add a Fixed Map Toggle to Your Divi Page Template

If you’re running a physical store and creating a website for it, many people may visit your website to get practical information, such as your address. Of course, that’s where your contact page comes in handy, but that’s not the only way you can seamlessly share contact details with your visitors. If you’re looking for a creative way to approach sharing your company’s address, you’ll like this tutorial. We’re showing you how to add a fixed map toggle dynamically to each page using Divi’s Theme Builder. We’ll start by creating a new page template. Then, we’ll include the dynamic page content in side the template’s body and we’ll add a fixed map toggle on top of the dynamic page content. You’ll be able to download the template JSON file for free as well!

Let’s get to it.

Before we dive into the tutorial, let’s take a quick look at the outcome across different screen sizes.

To lay your hands on the free page template, you will first need to download it using the button below. To gain access to the download you will need to subscribe to our Divi Daily email list by using the form below. As a new subscriber, you will receive even more Divi goodness and a free Divi Layout pack every Monday! If you’re already on the list, simply enter your email address below and click download. You will not be “resubscribed” or receive extra emails.

We’ll start this tutorial by navigating to the Divi Theme Builder and adding a new page template.

Then, enter the template’s body by selecting “Build Custom Body”.

Once inside the template editor, you’ll notice a section. Open the section settings and remove all default top and bottom padding.

Continue by adding a new row using the following column structure:

Without adding modules yet, open the row settings and modify the sizing settings as follows:

Remove all default top and bottom padding next.

To allow each page’s content to show up dynamically, we’ll use the Post Content Module inside this row.

On to the next row, which uses the following column structure:

Open the row settings, go to the design tab and change the sizing settings as follows:

Remove all default top and bottom padding next.

Then, open the column 1 settings and use a black background color.

Upload a background image of your choice next. You can find the background image in the zipped folder which you can download at the beginning of this tutorial.

Add the following lines of CSS code to the column’s main element as well:

Then, put the vertical overflow to auto. This, in combination with the max height in the previous step, makes sure a scrollbar appears as soon as the column exceeds an 80vh height.

Open the column 2 settings next and apply the following line of CSS code to the main element:

Time to add modules, starting with a Map Module in column 1. Add a map pin of your choice.

Move on to the module’s design tab and change the sizing settings as follows:

Add a Blurb Module below the Map Module in column 1. Use some content of your choice.

Move on to the design tab and change the icon settings as follows:

Then, modify the body text settings accordingly:

Apply the following padding values too:

And remove the default module animation in the animation settings.

On to column 2. There, we’ll add a Blurb Module without content.

Move on to the design tab and style the icon settings accordingly:

Then, navigate to the advanced tab and use the following lines of CSS code for the main element:

And add this line of CSS code inside the Blurb Image box:

Now that we have all elements in place, it’s time to focus on functionality. Start by opening the second row and applying the following CSS class:

Open the Blurb Module in column 2 next and use the following CSS class:

Then, add a Code Module below the Blurb Module in column 2.

Place some style and script tags inside the code box.

We’re using the following CSS code inside the style tags:

And the following JQuery code inside the script tags:

Last but not least, we’ll need to modify the second row’s position settings accordingly:

Once all changes have been applied, you can save all Divi Theme Builder changes and view the outcome on your website!

Now that we’ve gone through all the steps, let’s take a final look at the outcome across different screen sizes.

In this tutorial, we’ve shown you how to creatively include your business’ address details throughout your page designs. More specifically, we’ve shown you how to build a page template that includes a fixed map toggle, so your visitors can access your business’ location at all times! You were able to download the template JSON file for free as well. If you have any questions or suggestions, feel free to leave a comment in the comment section below.

If you’re eager to learn more about Divi and get more Divi freebies, make sure you subscribe to our email newsletter and YouTube channel so you’ll always be one of the first people to know and get benefits from this free content.

Loading...

End of content

No more pages to load