Tip: Image Maps (Server-Side) with WebCatalog

This WebDNA talk-list message is from

1997


It keeps the original formatting.
numero = 14693
interpreted = N
texte = Hey guys, I think I've figured out a workaround for getting server-side image maps (or at least something that acts like image maps) to work with WebCatalog. To recap for newcomers, the way image map plugins work doesn't allow important variables like [cart] to be passed thru to the next page. So if you want an image map at the top of every page on your site, you have to be very careful about 'losing' the cart# if someone clicks it....So I found this little-used (at least by me) feature of forms: you know that Submit button that every form needs to cause it to 'execute'? Well, you can replace that button with a graphic instead, and it turns out the browser will stick the x,y coordinates of the clickpoint into the form parameters for you! So if you use a little form that has no input fields, and just the graphic submit button, it looks and acts like an image map, except that now you can insert WebDNA variables. And on the next page, you can interpret the x,y coordinates (using WebDNA) to tell exactly where the click was.
What you'll see on the next page, test.tmpl is the following form variables: cart = 29484761982 submitme.x = 47 submitme.y = 13Unlike real image maps, which automatically redirect to a new URL, you have to (*get* to?) use WebDNA to figure out where the click was on the button. So if the graphic is 100 pixels wide, and the left-side means one thing, and the right-side means another:[ShowIf [submitme.x]<50] You clicked the left side! [/ShowIf] [ShowIf [submitme.x]>49] You clicked the right side! [/Showif]P.S. Obviously, *client-side* image maps have always worked fine, as long as the browser supports them.Grant Hulbert, V.P. Engineering | ==== eCommerce for the Rest of Us ==== Pacific Coast Software | WebCatalog, WebMerchant, 11770 Bernardo Plaza Court | SiteEdit Pro, PhotoMaster, San Diego, CA 92128 | Typhoon 619/675-1106 Fax: 619/675-0372 | http://www.smithmicro.com/ Associated Messages, from the most recent to the oldest:

    
  1. Tip: Image Maps (Server-Side) with WebCatalog (Grant Hulbert 1997)
Hey guys, I think I've figured out a workaround for getting server-side image maps (or at least something that acts like image maps) to work with WebCatalog. To recap for newcomers, the way image map plugins work doesn't allow important variables like [cart] to be passed thru to the next page. So if you want an image map at the top of every page on your site, you have to be very careful about 'losing' the cart# if someone clicks it....So I found this little-used (at least by me) feature of forms: you know that Submit button that every form needs to cause it to 'execute'? Well, you can replace that button with a graphic instead, and it turns out the browser will stick the x,y coordinates of the clickpoint into the form parameters for you! So if you use a little form that has no input fields, and just the graphic submit button, it looks and acts like an image map, except that now you can insert WebDNA variables. And on the next page, you can interpret the x,y coordinates (using WebDNA) to tell exactly where the click was.
[cart]>
What you'll see on the next page, test.tmpl is the following form variables: cart = 29484761982 submitme.x = 47 submitme.y = 13Unlike real image maps, which automatically redirect to a new URL, you have to (*get* to?) use WebDNA to figure out where the click was on the button. So if the graphic is 100 pixels wide, and the left-side means one thing, and the right-side means another:[ShowIf [submitme.x]<50] You clicked the left side! [/ShowIf] [ShowIf [submitme.x]>49] You clicked the right side! [/Showif]P.S. Obviously, *client-side* image maps have always worked fine, as long as the browser supports them.Grant Hulbert, V.P. Engineering | ==== eCommerce for the Rest of Us ==== Pacific Coast Software | WebCatalog, WebMerchant, 11770 Bernardo Plaza Court | SiteEdit Pro, PhotoMaster, San Diego, CA 92128 | Typhoon 619/675-1106 Fax: 619/675-0372 | http://www.smithmicro.com/ Grant Hulbert

DOWNLOAD WEBDNA NOW!

Top Articles:

Talk List

The WebDNA community talk-list is the best place to get some help: several hundred extremely proficient programmers with an excellent knowledge of WebDNA and an excellent spirit will deliver all the tips and tricks you can imagine...

Related Readings:

[WebDNA] online.db deadlock: your current options ... (2011) WebCat, switching from NT to OSX (2003) [OT] Multi - Language (2007) RE: Languages (1997) [SHOWIF AND/OR] (1997) embedding commands in form (1999) anyone interested in doing an open-source WebCatbasedforum? (2002) Attention all list readers (1997) tabs as delimiters (2004) RE: [WebDNA] How WebDNA email sending works... (2012) Template Cache problem (2000) Bit off subject -- Faxing orders (1997) greater than or equal to (1997) A few questions about server configuration (2000) Snake Bites (1997) Serial Number Question (1997) Roundup function? (1997) WebCommerce: Folder organization ? (1997) docs for WebCatalog2 (1997) Lastautonumber (2005)