HighDots Forums  

Layer Visibility Based on Previous Link

Macromedia Dreamweaver Macromedia Dreamweaver Discussions (macromedia.dreamweaver)


Discuss Layer Visibility Based on Previous Link in the Macromedia Dreamweaver forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Sophia Hohing
 
Posts: n/a

Default Layer Visibility Based on Previous Link - 07-01-2004 , 08:23 PM






Hello All:

Say I have a page that contains several layers, and I have many different
links to this page throughout my site. Is it possible to have the visibility
of a layer dependent upon the link that's used? For example, if you use Link
A, then the page will load with Layer A visible; if you click Link B, the
page will load with Layer B visible, etc.



Reply With Quote
  #2  
Old   
Mad Dog
 
Posts: n/a

Default Re: Layer Visibility Based on Previous Link - 07-01-2004 , 08:42 PM






This sounds like a job for SSI and a database........


Sophia Hohing wrote:
Quote:
Hello All:

Say I have a page that contains several layers, and I have many
different links to this page throughout my site. Is it possible to
have the visibility of a layer dependent upon the link that's used?
For example, if you use Link A, then the page will load with Layer A
visible; if you click Link B, the page will load with Layer B
visible, etc.



Reply With Quote
  #3  
Old   
Paul Whitham TMM
 
Posts: n/a

Default Re: Layer Visibility Based on Previous Link - 07-01-2004 , 09:21 PM



You could create a URL parameter on the links and then write an IF statement
around the visible tag of the layer.

The exact code would depend on the server language used.

--
Regards

Paul Whitham
Macromedia Certified Professional for Dreamweaver MX2004
Valleybiz Internet Design
www.valleybiz.net

Team Macromedia Volunteer for Ultradev/Dreamweaver MX
www.macromedia.com/support/forums/team_macromedia

"Sophia Hohing" <hohings (AT) seattleu (DOT) edu> wrote

Quote:
Hello All:

Say I have a page that contains several layers, and I have many different
links to this page throughout my site. Is it possible to have the
visibility
of a layer dependent upon the link that's used? For example, if you use
Link
A, then the page will load with Layer A visible; if you click Link B, the
page will load with Layer B visible, etc.





Reply With Quote
  #4  
Old   
E Michael Brandt
 
Posts: n/a

Default Re: Layer Visibility Based on Previous Link - 07-01-2004 , 09:33 PM



I think this can all be done on the client side without need of a serve
language at all. As has been suggested, have each link to the page with a
unique querystring appended to the url, and have the target page read the
querystring (location.search is a handy way to get at it) and have
conditional code on the page that sets the visiblilty of the layers based on
the value in the querystring.

--
E. Michael Brandt
www.valleywebdesigns.com
home of JustSo PictureWindows 3


"Paul Whitham TMM" <paul (AT) valleybiz (DOT) net> wrote

Quote:
You could create a URL parameter on the links and then write an IF
statement
around the visible tag of the layer.

The exact code would depend on the server language used.

--
Regards

Paul Whitham
Macromedia Certified Professional for Dreamweaver MX2004
Valleybiz Internet Design
www.valleybiz.net

Team Macromedia Volunteer for Ultradev/Dreamweaver MX
www.macromedia.com/support/forums/team_macromedia

"Sophia Hohing" <hohings (AT) seattleu (DOT) edu> wrote in message
news:cc29tv$5h0$1 (AT) forums (DOT) macromedia.com...
Hello All:

Say I have a page that contains several layers, and I have many
different
links to this page throughout my site. Is it possible to have the
visibility
of a layer dependent upon the link that's used? For example, if you use
Link
A, then the page will load with Layer A visible; if you click Link B,
the
page will load with Layer B visible, etc.







Reply With Quote
  #5  
Old   
Sophia Hohing
 
Posts: n/a

Default Re: Layer Visibility Based on Previous Link - 07-01-2004 , 09:42 PM



Quote:
You could create a URL parameter on the links and then write an IF
statement
around the visible tag of the layer.

The exact code would depend on the server language used.
Thanks for your help!

I'm not quite clear though, do you mean assign the URL a name? For example:

<a name="LinkA" href="the_page.htm">Link A</a>

then in "the_page":

<div id="LayerA" style="position:absolute;
if (Link A) visibility:visible; ....>

This is just basic html code and I'm not sure how to do what you're
suggesting.




Reply With Quote
  #6  
Old   
Murray *TMM*
 
Posts: n/a

Default Re: Layer Visibility Based on Previous Link - 07-01-2004 , 09:44 PM



Mick can tell you how to do this very easily with a bit of client-side
javascript, e.g.,

<a href="page2.html?a>Link for layer1</a>
<a href="page2.html?b>Link for layer2</a>
<a href="page2.html?c>Link for layer3</a>

where page2 parses the a, b, or c from the command line and show-hides the
appropriate layer.

--
Murray --- ICQ 71997575
Team Macromedia Volunteer for Dreamweaver MX
(If you *MUST* email me, don't LAUGH when you do so!)
==================
news://forums.macromedia.com/macromedia.dreamweaver - THE BEST WAY TO GET
ANSWERS
==================
http://www.dreamweavermx-templates.com - Template Triage!
http://www.projectseven.com/go - DW FAQs, Tutorials & Resources
http://www.dwfaq.com - DW FAQs, Tutorials & Resources
http://www.macromedia.com/support/search/ - Macromedia (MM) Technotes
==================

"Mad Dog" <md (AT) mdp (DOT) com> wrote

Quote:
This sounds like a job for SSI and a database........


Sophia Hohing wrote:
Hello All:

Say I have a page that contains several layers, and I have many
different links to this page throughout my site. Is it possible to
have the visibility of a layer dependent upon the link that's used?
For example, if you use Link A, then the page will load with Layer A
visible; if you click Link B, the page will load with Layer B
visible, etc.





Reply With Quote
  #7  
Old   
Sophia Hohing
 
Posts: n/a

Default Re: Layer Visibility Based on Previous Link - 07-01-2004 , 09:59 PM



Oh I see... I would have to write a JavaScript function.

"Sophia Hohing" <hohings (AT) seattleu (DOT) edu> wrote

Quote:
You could create a URL parameter on the links and then write an IF
statement
around the visible tag of the layer.

The exact code would depend on the server language used.

Thanks for your help!

I'm not quite clear though, do you mean assign the URL a name? For
example:

a name="LinkA" href="the_page.htm">Link A</a

then in "the_page":

div id="LayerA" style="position:absolute;
if (Link A) visibility:visible; ....

This is just basic html code and I'm not sure how to do what you're
suggesting.





Reply With Quote
  #8  
Old   
Murray *TMM*
 
Posts: n/a

Default Re: Layer Visibility Based on Previous Link - 07-01-2004 , 10:10 PM



Get Mick to do it for you!

http://groups.google.com/groups?hl=en&lr=&ie=UTF-8&threadm=3A2FDAAE.971584CC%40mickweb.com&rnum=25& prev=/groups%3Fq%3Dhide%2Blayer%2Bgroup:macromedia.dream weaver%2Bauthor:mick%26hl%3Den%26lr%3D%26ie%3DUTF-8%26start%3D20%26sa%3DN

(Watch out for the wrap in that link)

--
Murray --- ICQ 71997575
Team Macromedia Volunteer for Dreamweaver MX
(If you *MUST* email me, don't LAUGH when you do so!)
==================
news://forums.macromedia.com/macromedia.dreamweaver - THE BEST WAY TO GET
ANSWERS
==================
http://www.dreamweavermx-templates.com - Template Triage!
http://www.projectseven.com/go - DW FAQs, Tutorials & Resources
http://www.dwfaq.com - DW FAQs, Tutorials & Resources
http://www.macromedia.com/support/search/ - Macromedia (MM) Technotes
==================

"Sophia Hohing" <hohings (AT) seattleu (DOT) edu> wrote

Quote:
Oh I see... I would have to write a JavaScript function.

"Sophia Hohing" <hohings (AT) seattleu (DOT) edu> wrote in message
news:cc2ehr$9vc$1 (AT) forums (DOT) macromedia.com...
You could create a URL parameter on the links and then write an IF
statement
around the visible tag of the layer.

The exact code would depend on the server language used.

Thanks for your help!

I'm not quite clear though, do you mean assign the URL a name? For
example:

a name="LinkA" href="the_page.htm">Link A</a

then in "the_page":

div id="LayerA" style="position:absolute;
if (Link A) visibility:visible; ....

This is just basic html code and I'm not sure how to do what you're
suggesting.







Reply With Quote
  #9  
Old   
Mick White
 
Posts: n/a

Default Re: Layer Visibility Based on Previous Link - 07-01-2004 , 11:47 PM



http://www.mickweb.com/javascript/layers/pageA.html

Moved and updated.
Mick

Murray *TMM* wrote:

Quote:
Get Mick to do it for you!

http://groups.google.com/groups?hl=en&lr=&ie=UTF-8&threadm=3A2FDAAE.971584CC%40mickweb.com&rnum=25& prev=/groups%3Fq%3Dhide%2Blayer%2Bgroup:macromedia.dream weaver%2Bauthor:mick%26hl%3Den%26lr%3D%26ie%3DUTF-8%26start%3D20%26sa%3DN

(Watch out for the wrap in that link)


Reply With Quote
  #10  
Old   
Sophia Hohing
 
Posts: n/a

Default Re: Layer Visibility Based on Previous Link - 07-01-2004 , 11:49 PM



Nothing's happening....

So I have the following in the body of my target page, pretty much as Mick
described:

<script language="JavaScript">
var thelayer= (location.search)? location.search.substring(1):"default";
MM_showHideLayers(thelayer,'','show')
</script>

I gathered from his posting that the variable declaration is supposed to be
in the head, but that created errors so I did the above.

There are no errors now, but either thelayer is not becoming "default", or
showHideLayers is not working.

I appended ?layerid to my links, but the target page still loads without
effect.

What am I missing?

"Murray *TMM*" <forums (AT) HAHAgreat-web-sights (DOT) com> wrote

Quote:
Get Mick to do it for you!


http://groups.google.com/groups?hl=en&lr=&ie=UTF-8&threadm=3A2FDAAE.971584CC%40mickweb.com&rnum=25& prev=/groups%3Fq%3Dhide%2Blayer%2Bgroup:macromedia.dream weaver%2Bauthor:mick%26hl%3Den%26lr%3D%26ie%3DUTF-8%26start%3D20%26sa%3DN

(Watch out for the wrap in that link)



Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.