This is Interesting: Free Magazines for Graphics designers and webmasters
Home > Archive > Dreamweaver > June 2004 > Urgent help please! Conditional SSI
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
Urgent help please! Conditional SSI
|
|
| cjf3rules 2004-06-11, 12:14 pm |
| I am using .shtml pages with SSI, and I have two different "include" content
pages.
I have the variable "favorite" set to either "east" or "west", like this (via
javascript):
favorite="east"; (or) favorite="west";
Is it possible to have the SSI Include directive syntax swapped dynamically
based on whether the variable is set to east or west?
I tried something like this, but it doesn't actually parse the Include file
into the page:
if (favorite == "east") {
document.write('<!--#include file="includes/myTestInclude2.shtml"
-->');
}
Does anybody know if this can be done, and how? I appreciate ANY help you can
give me on this one!
| |
| Murray *TMM* 2004-06-11, 12:14 pm |
| Since your js is client side, and the SSI is server side, I doubt that there
is a way to make this scheme work.
--
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
==================
"cjf3rules" <webforumsuser@macromedia.com> wrote in message
news:cacd1f$nqa$1@forums.macromedia.com...
> I am using .shtml pages with SSI, and I have two different "include"
content
> pages.
>
> I have the variable "favorite" set to either "east" or "west", like this
(via
> javascript):
> favorite="east"; (or) favorite="west";
>
> Is it possible to have the SSI Include directive syntax swapped
dynamically
> based on whether the variable is set to east or west?
>
> I tried something like this, but it doesn't actually parse the Include
file
> into the page:
>
> if (favorite == "east") {
> document.write('<!--#include
file="includes/myTestInclude2.shtml"
> -->');
> }
>
> Does anybody know if this can be done, and how? I appreciate ANY help
you can
> give me on this one!
>
| |
|
| Xref: kermit macromedia.dreamweaver:915193
take a look at http://www.bignosebird.com/sdocs/extend.shtml
if your server supports xSSI you can put the logic into the SSI call itself,
to be processed on the server.
clientside JavaScript wont work for this-
>
> Is it possible to have the SSI Include directive syntax swapped dynamically
> based on whether the variable is set to east or west?
| |
| cjf3rules 2004-06-11, 12:14 pm |
| Thanks Murray and Alan for getting back to me.
Murray: That's what I was afraid of. It seemed like the two don't talk to
each other.
Alan: I looked at that, but couldn't get the javascript variable into the
conditional statement. In light of what Murray said, I'm not sure that this
can be done.
| |
| Michael Fesser 2004-06-11, 7:14 pm |
| .oO(cjf3rules)
> Murray: That's what I was afraid of. It seemed like the two don't talk to
>each other.
They simply can't. At the time when JS is executed the server-side
parsing and processing is finished already.
> Alan: I looked at that, but couldn't get the javascript variable into the
>conditional statement. In light of what Murray said, I'm not sure that this
>can be done.
You can always do it with a server-side scripting language.
Micha
| |
|
|
> Thanks Murray and Alan for getting back to me.
>
> Murray: That's what I was afraid of. It seemed like the two don't talk to
> each other.
>
> Alan: I looked at that, but couldn't get the javascript variable into the
> conditional statement. In light of what Murray said, I'm not sure that this
> can be done.
>
depending on what the page is doing and when it's doing it- the JavaScript
variable doesn't exist in the code on the server- it only exists and has a
value when the clientside JS is executed...
don't know what the big picture is on this so can't suggest more.
| |
| Murray *TMM* 2004-06-11, 7:14 pm |
| You could use a server variable to select the appropriate include,
however....
--
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
==================
"Alan" <dont_mail_me_period@macromedia.com> wrote in message
news:BCEF4B13.1996E7%dont_mail_me_period@macromedia.com...
>
>
to[color=darkred]
the[color=darkred]
this[color=darkred]
>
> depending on what the page is doing and when it's doing it- the JavaScript
> variable doesn't exist in the code on the server- it only exists and has a
> value when the clientside JS is executed...
>
> don't know what the big picture is on this so can't suggest more.
>
|
|
|
| | Copyright 2003 - 2009 forum4designers.com Software forum Computer Hardware reviews |
|