HighDots Forums  

Urgent help please! Conditional SSI

Macromedia Dreamweaver Macromedia Dreamweaver Discussions (macromedia.dreamweaver)


Discuss Urgent help please! Conditional SSI in the Macromedia Dreamweaver forum.



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

Default Urgent help please! Conditional SSI - 06-11-2004 , 09:45 AM






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!


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

Default Re: Urgent help please! Conditional SSI - 06-11-2004 , 09:49 AM






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 (AT) macromedia (DOT) com> wrote

Quote:
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!




Reply With Quote
  #3  
Old   
Alan
 
Posts: n/a

Default Re: Urgent help please! Conditional SSI - 06-11-2004 , 09:57 AM



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-

Quote:
Is it possible to have the SSI Include directive syntax swapped dynamically
based on whether the variable is set to east or west?


Reply With Quote
  #4  
Old   
cjf3rules
 
Posts: n/a

Default Re: Urgent help please! Conditional SSI - 06-11-2004 , 10:06 AM



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.


Reply With Quote
  #5  
Old   
Alan
 
Posts: n/a

Default Re: Urgent help please! Conditional SSI - 06-11-2004 , 11:42 AM





Quote:
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.



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

Default Re: Urgent help please! Conditional SSI - 06-11-2004 , 11:55 AM



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 (AT) macromedia (DOT) com> wrote

Quote:

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.




Reply With Quote
  #7  
Old   
Michael Fesser
 
Posts: n/a

Default Re: Urgent help please! Conditional SSI - 06-11-2004 , 12:05 PM



.oO(cjf3rules)

Quote:
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.

Quote:
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


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.