Image mapping or hotspots?

Adam_Johan
New Member
2 0 1

I want to have 1 image with say 5 clickagle spots on the image? Like something this allows -> https://www.image-map.net/

I found one app that provides close to what i want -> https://apps.shopify.com/image-hotspots-by-widgetic

But it doesn't allow hyperlinks and the hotspots aren't customizable.

 

Replies 14 (14)
Mircea_Piturca
Shopify Partner
1540 43 332

Hey @Adam_Johan 

I've made a simple Shopify section that allows you to place hotspots/tooltips on a prset image.

You can have a look at https://sections.design/blogs/shopify/product-tooltips, there is a demo there, installation instructions and also a link to Github where you can get the code.

 

The tooltip content is HTML so you can add links, images...

There are some color options in the theme settings.

 

Hope it helps

 

 

 

Finally—Add variant descriptions to your products
aj007
Excursionist
33 0 67

Hi @Mircea_Piturca - your https://sections.design/blogs/shopify/product-tooltips seems to have great promise, but I can't figure out how to configure my image in Shopify.

 

On a Shopify custom page, do I add something like this?

 

<div id="shopify-section-tooltips" class="shopify-section sd-tooltips" label="Main image"><img src="https://cdn.shopify.com/s/files ... .jpg?v=1000099300"></div>

 

 

Or do I configure the .jpg in tooltips.liquid somehow? I've read your instructions and the code a few times, but Shopify is new to me and I can't figure this out 😞

Mircea_Piturca
Shopify Partner
1540 43 332

Hey @aj007 

On a product page you can include the section using:

 

{% section "tooltips" %}

On homepage, you can select Tooltips" section from the Theme Editor 

 

Make sure you add these files to their respective folders: https://github.com/mirceapiturca/Sections/tree/master/Tooltips

See assets and sections folders.

 

After this, go to theme editor. In the section settings you can select the image to use and all the tooltips content.

Hope it helps

 

Finally—Add variant descriptions to your products
aj007
Excursionist
33 0 67

Hi @Mircea_Piturca 

 

I had already copied tooltips.liquid into sections and tooltips.js into assets - and finally found the UI you're referring to in the Home page Theme Editor now that you explained it (probably should note that in your docs as well).

 

But... I'm actually looking to add this to one of my custom pages (i.e. in '....myshopify.com/admin/pages'), where all I'm given is an HTML editor. Do I have to create a whole new page template in order to add {% section "tooltips" %} or something?

 

Sorry, I'm quite new at all this Shopify stuff 😞

 

 

aj007
Excursionist
33 0 67

Hi again @Mircea_Piturca ... think I figured most of it out on my own.

 

One thing I can't figure out - how to change the color of the ordered list's '.tooltip-title' given that my site's background is (almost) black, as you can see in the following screenshot:

 

Screenshot 2019-07-04 at 08.11.00.png

 

 

Other than that this is working great. Thanks so much!

 

PS. for others' benefit, to get this far I...

  • Copied tooltips.liquid into sections and tooltips.js into assets

  • Created new page template called 'page.tooltips.liquid' and pasted this at the bottom:
    {% section "tooltips" %}

  • Changed my custom page to use this new template: 'page.tooltips'

  • Edited my custom page using the Theme Editor (Online Store | Themes | Customize) to add and position the tooltips (and the image itself)

  • Various tweaks to 'tooltips.liquid' to squish things a bit more for small screens
Mircea_Piturca
Shopify Partner
1540 43 332

Hey,

Happy you got it going.

 

Hopefully with the new Shopify Sections changes the process will me more straightforward. 

Good point, I will try to update the install guide.

 

There are no section settings for what particular case but you can solve it with CSS.

Assuming that your "mobile" breakpoint is at 660px, you can use a mediaquerry to make the title white:

 

@media (max-width: 660px) { 
  .tooltip-title {
    color: white;
  }
}

 

Looking forward to see a link when this goes live!

  

Finally—Add variant descriptions to your products
aj007
Excursionist
33 0 67

Thanks @Mircea_Piturca - I tried the following and it worked for both laptop and mobile. Not sure if this is a better or worse solution for tooltip-title than what you propose above (??)

 

I only half know what I'm doing 🙂

 

Wrapped with <span style="color: #E7E7E7;"> ... </span> ... so:

        <span style="color: #E7E7E7;"><strong class="tooltip-title" role="none">{{ block.settings.title }}</strong></span>
Mircea_Piturca
Shopify Partner
1540 43 332

That will work but CSS it's a better option and will give you more flexibility in the future.

Finally—Add variant descriptions to your products
LynetteS
New Member
1 0 0

Is it possible to add a hyperlink to the popup?

Mircea_Piturca
Shopify Partner
1540 43 332

Hey @LynetteS 

The tooltip supports HTML, you can add the link in there. Something like this:

<a href="some-link-url">Some link</a>

 

Please see the attachment.

Screen Shot 2021-02-10 at 11.21.47.png 

Finally—Add variant descriptions to your products
FakhriAshour
Tourist
3 0 1

Hello

 

Thanks for the app, I've just tried it and it works well, but i cant figure out how to make the main image smaller on desktop, it looks huge 

Mircea_Piturca
Shopify Partner
1540 43 332

@FakhriAshour It is a CSS issue. Your theme is interfering with the section code.

Please post here the URL and we will be able to tell what is wrong.

Finally—Add variant descriptions to your products
FakhriAshour
Tourist
3 0 1
Hello, thanks for the the reply

heres's an example page with the image
https://ashourshoes.com/products/depp-cap-toe-oxford
Mircea_Piturca
Shopify Partner
1540 43 332

@FakhriAshour you need to set a max-width on that sections.

Just add this into your theme CSS file:

 

.tooltips-section {
  max-width: 73.8rem;
  margin: 0 auto;
}
Finally—Add variant descriptions to your products