  {"id":3586,"date":"2024-12-11T15:55:22","date_gmt":"2024-12-11T20:55:22","guid":{"rendered":"https:\/\/www.montclair.edu\/university-communications\/?page_id=3586"},"modified":"2024-12-11T15:55:22","modified_gmt":"2024-12-11T20:55:22","slug":"hotspots","status":"publish","type":"page","link":"https:\/\/www.montclair.edu\/university-communications\/web-development-and-experience\/montclair-edu-website-framework\/wordpress-shortcodes\/hotspots\/","title":{"rendered":"Hotspots"},"content":{"rendered":"<p>The <strong>hotspot<\/strong> and <strong>hotpoint<\/strong> shortcodes allows you to place markers on an image. The visitor can mouse-over or tab to these markers to expand a label. This is achieved by listing the hotpoint shortcodes within the <div class=\"hotspot\"> shortcode. Hotpoints are placed by assigning percentage points to the left and top attributes:\n<h2>Example<\/h2>\n<div class=\"hotspot\"><img decoding=\"async\" class=\"mlt-responsive-image\" data-original-image=\"\/university-communications\/wp-content\/uploads\/sites\/144\/2024\/12\/campus-aerial.jpg.5.2x.generic.jpg\" src=\"\/responsive-media\/cache\/university-communications\/wp-content\/uploads\/sites\/144\/2024\/12\/campus-aerial.jpg.5.2x.generic.jpg.0.1x.generic.jpg\" alt=\"Aerial Photo of Campus\"\/><\/div>\n<a href="https:\/\/www.montclair.edu\/campus-map\/#CO" class='hotspot-point' tabindex='0' style='left:39.60%; top:63.50%;'><span class='text'>Susan A. Cole Hall<\/span><\/a><br \/>\n<span class='hotspot-point' tabindex='0' style='left:46.89%; top:34.91%;'><span class='text'>Freeman Hall<\/span><\/span><br \/>\n<span class='hotspot-point' tabindex='0' style='left:64.44%; top:33.50%;'><span class='text'>Russ Hall<\/span><\/span><br \/>\n<span class='hotspot-point' tabindex='0' style='left:73.55%; top:44.79%;'><span class='text'>John J Cali School of Music<\/span><\/span><br \/>\n<\/div>\n<h2>Code Sample<\/h2>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\n\r\n&#x5B;&#x5B;hotspot image=&quot;\/university-communications\/wp-content\/uploads\/sites\/144\/2024\/12\/campus-aerial.jpg.5.2x.generic.jpg&quot;]\r\n\r\n&#x5B;hotpoint left=&quot;39.6&quot; top=&quot;63.5&quot; label=&quot;Susan A. Cole Hall&quot; url=&quot;https:\/\/www.montclair.edu\/campus-map\/#CO&quot;]\r\n&#x5B;hotpoint left=&quot;46.89&quot; top=&quot;34.91&quot; label=&quot;Freeman Hall&quot;]\r\n&#x5B;hotpoint left=&quot;64.44&quot; top=&quot;33.5&quot; label=&quot;Russ Hall&quot;]\r\n&#x5B;hotpoint left=&quot;73.55&quot; top=&quot;44.79&quot; label=&quot;John J Cali School of Music&quot;]\r\n\r\n&#x5B;\/hotspot]]\r\n\r\n<\/pre>\n<h2>Attributes<\/h2>\n<h3>Hotspot Shortcode<\/h3>\n<table class=\"responsive-table\">\n<thead>\n<tr>\n<th>Name<\/th>\n<th>Possible Values<\/th>\n<th>Required<\/th>\n<th>Notes<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>image<\/td>\n<td>url of an image<\/td>\n<td>Yes<\/td>\n<td>The image URL should be for an image in your media library.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h3>Hotpoint Shortcode<\/h3>\n<table class=\"responsive-table\">\n<thead>\n<tr>\n<th>Name<\/th>\n<th>Possible Values<\/th>\n<th>Required<\/th>\n<th>Notes<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>label<\/td>\n<td>text<\/td>\n<td>Yes<\/td>\n<td>This is a text field &#8211; not HTML.<\/td>\n<\/tr>\n<tr>\n<td>left<\/td>\n<td>number<\/td>\n<td>Yes<\/td>\n<td>The left position of the point in percentage.<\/td>\n<\/tr>\n<tr>\n<td>top<\/td>\n<td>number<\/td>\n<td>Yes<\/td>\n<td>The top position of the point in percentage.<\/td>\n<\/tr>\n<tr>\n<td>url<\/td>\n<td>URL of a page<\/td>\n<td>No<\/td>\n<td>If you provide a URL the hotpoint will act as a link.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h2>Getting Coordinates in Percentage<\/h2>\n<p>The <strong>hotpoint<\/strong> shortcode requires you to provide coordinates for the point in percentage, not pixels. This ensures that your points are placed properly at any resolution or size &#8211; from small phone displays to large desktop monitors.<\/p>\n<p>Using Adobe Photoshop it&#8217;s relatively easy to get percentage coordinates for your image.<\/p>\n<h3>Step 1: Get the Image Resolution<\/h3>\n<p>Open your image in Photoshop and then go to Image &gt; Image Size. On a scrap piece of paper, write down the width and height of your image.<\/p>\n<div class=\"prpl-row\">\n<div class=\"prpl-column one-half\">\n<figure class=\"responsive-image-holder wp-caption alignnone\"><img decoding=\"async\" class=\"mlt-responsive-image\" data-original-image=\"\/university-communications\/wp-content\/uploads\/sites\/144\/2024\/12\/step1a.png.2.1x.generic.jpg\" src=\"\/responsive-media\/cache\/university-communications\/wp-content\/uploads\/sites\/144\/2024\/12\/step1a.png.2.1x.generic.jpg.0.1x.generic.jpg\"\/><\/figure>\n<\/div>\n<div class=\"prpl-column one-half\">\n<figure class=\"responsive-image-holder wp-caption alignnone\"><img decoding=\"async\" class=\"mlt-responsive-image\" data-original-image=\"\/university-communications\/wp-content\/uploads\/sites\/144\/2024\/12\/step1b.png.2.1x.generic.jpg\" src=\"\/responsive-media\/cache\/university-communications\/wp-content\/uploads\/sites\/144\/2024\/12\/step1b.png.2.1x.generic.jpg.0.1x.generic.jpg\"\/><\/figure>\n<\/div>\n<\/div>\n<h3>Step 2: Get the Coordinate in Pixels<\/h3>\n<p>Choose the ruler tool. Click and drag on your image <em>starting <\/em>at the place you want to put your point. Copy down the X and Y coordinates for each <strong>hotpoint<\/strong> you&#8217;d like to create.<\/p>\n<div class=\"prpl-row\">\n<div class=\"prpl-column one-third\">\n<figure class=\"responsive-image-holder wp-caption alignnone\"><img decoding=\"async\" class=\"mlt-responsive-image\" data-original-image=\"\/university-communications\/wp-content\/uploads\/sites\/144\/2024\/12\/step2a.png.1.1x.generic.jpg\" src=\"\/responsive-media\/cache\/university-communications\/wp-content\/uploads\/sites\/144\/2024\/12\/step2a.png.1.1x.generic.jpg.0.1x.generic.jpg\"\/><\/figure>\n<\/div>\n<div class=\"prpl-column one-third\">\n<figure class=\"responsive-image-holder wp-caption alignnone\"><img decoding=\"async\" class=\"mlt-responsive-image\" data-original-image=\"\/university-communications\/wp-content\/uploads\/sites\/144\/2024\/12\/step2b.png.1.1x.generic.jpg\" src=\"\/responsive-media\/cache\/university-communications\/wp-content\/uploads\/sites\/144\/2024\/12\/step2b.png.1.1x.generic.jpg.0.1x.generic.jpg\"\/><\/figure>\n<\/div>\n<div class=\"prpl-column one-third\">\n<figure class=\"responsive-image-holder wp-caption alignnone\"><img decoding=\"async\" class=\"mlt-responsive-image\" data-original-image=\"\/university-communications\/wp-content\/uploads\/sites\/144\/2024\/12\/step2c.png.1.1x.generic.jpg\" src=\"\/responsive-media\/cache\/university-communications\/wp-content\/uploads\/sites\/144\/2024\/12\/step2c.png.1.1x.generic.jpg.0.1x.generic.jpg\"\/><\/figure>\n<\/div>\n<\/div>\n<h3>Step 3: Calculate Percentages<\/h3>\n<p>Now that you have the <strong>width<\/strong>, <strong>height<\/strong>, <strong>x<\/strong>, and <strong>y<\/strong> values for your image, you can easily calculate the <strong>left<\/strong> and <strong>top<\/strong> values using the formulae:<\/p>\n<ul>\n<li><strong>left<\/strong> = 100 \u00d7 (<strong>x<\/strong>\/<strong>width<\/strong>)<\/li>\n<li><strong>top<\/strong> = 100 \u00d7 (<strong>y<\/strong>\/<strong>height<\/strong>)<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>The hotspot and hotpoint shortcodes allows you to place markers on an image. The visitor can mouse-over or tab to these markers to expand a label. This is achieved by listing the hotpoint shortcodes within the Code Sample &#x5B;hotspot image=&quot;\/university-communications\/wp-content\/uploads\/sites\/144\/2024\/12\/campus-aerial.jpg.5.2x.generic.jpg&quot;] &#x5B;hotpoint left=&quot;39.6&quot; top=&quot;63.5&quot; label=&quot;Susan A. Cole Hall&quot; url=&quot;https:\/\/www.montclair.edu\/campus-map\/#CO&quot;] &#x5B;hotpoint left=&quot;46.89&quot; top=&quot;34.91&quot; label=&quot;Freeman Hall&quot;] &#x5B;hotpoint left=&quot;64.44&quot; [&hellip;]<\/p>\n","protected":false},"author":411,"featured_media":3554,"parent":3552,"menu_order":24,"comment_status":"closed","ping_status":"closed","template":"","meta":{"inline_featured_image":false,"footnotes":""},"class_list":["post-3586","page","type-page","status-publish","has-post-thumbnail","hentry"],"_links":{"self":[{"href":"https:\/\/www.montclair.edu\/university-communications\/wp-json\/wp\/v2\/pages\/3586","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.montclair.edu\/university-communications\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/www.montclair.edu\/university-communications\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/www.montclair.edu\/university-communications\/wp-json\/wp\/v2\/users\/411"}],"replies":[{"embeddable":true,"href":"https:\/\/www.montclair.edu\/university-communications\/wp-json\/wp\/v2\/comments?post=3586"}],"version-history":[{"count":3,"href":"https:\/\/www.montclair.edu\/university-communications\/wp-json\/wp\/v2\/pages\/3586\/revisions"}],"predecessor-version":[{"id":3840,"href":"https:\/\/www.montclair.edu\/university-communications\/wp-json\/wp\/v2\/pages\/3586\/revisions\/3840"}],"up":[{"embeddable":true,"href":"https:\/\/www.montclair.edu\/university-communications\/wp-json\/wp\/v2\/pages\/3552"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.montclair.edu\/university-communications\/wp-json\/wp\/v2\/media\/3554"}],"wp:attachment":[{"href":"https:\/\/www.montclair.edu\/university-communications\/wp-json\/wp\/v2\/media?parent=3586"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}