This is Interesting: Free Magazines for Graphics designers and webmasters  


Home > Archive > Dreamweaver > February 2006 > Alternative to 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 Alternative to SSI?
Ken Zenachon

2006-02-12, 6:41 pm

The problem I'm having is with incorporating a nav menu as an include.
The menu is graphic based and each button has three states-- Off, On
and Current. I was going to use SSIs to include the menu and to
incorporate the logic, using #if, #else, but the IIS server I'm using
(hostmysite.com) doesn't seem to support these statements, passing
them on to the browser as text. I've tried different syntax but
nothing seems to work. The same code works on Apache servers, so I
know there's nothing wrong with my script.

I've spoken to the server admins at the hosting company and they can't
give me a straight answer as to whether or not #if directives are
supported on their IIS server, so I have to assume they're not.

In case someone wants to suggest it, I already know from reading
Microsoft help documentation that files ending in .ASP will only be
parsed for the #include directive, so the included files have the
extension .shtml.

Given that the pages with the databse connectivity are coded for ASP
(they have to be, in order to connect to an Access DB, right?), what
are my options for including a menu with server-side logic to control
current page button states?


Piyono
Michael Fesser

2006-02-12, 6:41 pm

..oO(Ken Zenachon)

>I've spoken to the server admins at the hosting company and they can't
>give me a straight answer as to whether or not #if directives are
>supported on their IIS server [...]


That would be reason enough for me to change the host. If they don't
know their own servers ...

Micha
darrel

2006-02-12, 6:41 pm

> I've spoken to the server admins at the hosting company and they can't
> give me a straight answer as to whether or not #if directives are
> supported on their IIS server, so I have to assume they're not.


IIS? My guess is possibly not. I think the advanced SSI logic is typically
an Apache thing.

For IIS, the solution is to just use ASP for your logic:.

> Given that the pages with the databse connectivity are coded for ASP
> (they have to be, in order to connect to an Access DB, right?), what
> are my options for including a menu with server-side logic to control
> current page button states?


Oh, wait...you are already using ASP? Then that's your option. Just use ASP.

Include your menu as an include, and then in your menu file use ASP logic to
decide how you want each item to display.

-Darrel


Cary

2006-02-12, 6:41 pm

If your using ASP, just use it to do your logic in your SSI file. I do that
method myself.


"Ken Zenachon" <spamaddy1@yahoo.com> wrote in message
news:pj0qu1tisttnqip6qn7r3r2o6idpqs7t82@4ax.com...
> The problem I'm having is with incorporating a nav menu as an include.
> The menu is graphic based and each button has three states-- Off, On
> and Current. I was going to use SSIs to include the menu and to
> incorporate the logic, using #if, #else, but the IIS server I'm using
> (hostmysite.com) doesn't seem to support these statements, passing
> them on to the browser as text. I've tried different syntax but
> nothing seems to work. The same code works on Apache servers, so I
> know there's nothing wrong with my script.
>
> I've spoken to the server admins at the hosting company and they can't
> give me a straight answer as to whether or not #if directives are
> supported on their IIS server, so I have to assume they're not.
>
> In case someone wants to suggest it, I already know from reading
> Microsoft help documentation that files ending in .ASP will only be
> parsed for the #include directive, so the included files have the
> extension .shtml.
>
> Given that the pages with the databse connectivity are coded for ASP
> (they have to be, in order to connect to an Access DB, right?), what
> are my options for including a menu with server-side logic to control
> current page button states?
>
>
> Piyono



Ken Zenachon

2006-02-16, 6:40 pm

Ah, so ASP does have logic functions.
This is good.

What's the ASP equivalent of this script:
<!--#if expr="${DOCUMENT_URI} = /"home.html/"" -->
do this
<!-- #else -->
do this
<!--#endif -->
?

KZ

On Fri, 10 Feb 2006 14:58:10 -0800, "Cary" <nospam@nospam.nospam>
wrote:

>If your using ASP, just use it to do your logic in your SSI file. I do that
>method myself.
>
>
>"Ken Zenachon" <spamaddy1@yahoo.com> wrote in message
>news:pj0qu1tisttnqip6qn7r3r2o6idpqs7t82@4ax.com...
>

Ken Zenachon

2006-02-16, 6:40 pm

It's OK, I figured it out.

Thanks,

KZ



On Mon, 13 Feb 2006 14:40:05 -0500, Ken Zenachon <spamaddy1@yahoo.com>
wrote:
[color=darkred]
>Ah, so ASP does have logic functions.
>This is good.
>
>What's the ASP equivalent of this script:
><!--#if expr="${DOCUMENT_URI} = /"home.html/"" -->
>do this
><!-- #else -->
>do this
><!--#endif -->
>?
>
>KZ
>
>On Fri, 10 Feb 2006 14:58:10 -0800, "Cary" <nospam@nospam.nospam>
>wrote:
>
Murray *TMM*

2006-02-16, 6:40 pm

What was your solution?

--
Murray --- ICQ 71997575
Team Macromedia Volunteer for Dreamweaver
(If you *MUST* email me, don't LAUGH when you do so!)
==================
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
==================


"Ken Zenachon" <spamaddy1@yahoo.com> wrote in message
news:id32v1dn5vpc61dnqlp0c93gm1fog8bvk9@4ax.com...[color=darkred]
> It's OK, I figured it out.
>
> Thanks,
>
> KZ
>
>
>
> On Mon, 13 Feb 2006 14:40:05 -0500, Ken Zenachon <spamaddy1@yahoo.com>
> wrote:
>


Ken Zenachon

2006-02-16, 6:51 pm

Hi, Murray,

Glad you asked!
After darrel's reply to this thread (that I use ASP logic) I posted a
message on the sitepoint ASP forum, asking for someone to translate
the SSI directive to ASP. Someone was kind enough to oblige me, but
his reply assumed I knew something about VBScript. I didn't, but after
45 minutes of trial and error, logical deduction and intense
Google-ing I learned enough to make my code work.

Here's the sitepoint.com thread:
http://www.sitepoint.com/forums/showthread.php?t=347141

What's that? You want all the details? Well, I'd be delighted!

Basically, the poster parroted my ambiguous conditional actions in his
code, so where I asked for an eqivalent of:
<!--#if expr="${DOCUMENT_URI} = /"home.html/"" -->
do this
<!-- #else -->
do this
<!--#endif -->

He replied with:
<%
If Instr(Request.ServerVariables("SCRIPT_NAME"), "home.html") <> 0
Then
'Do this
Else
'Do that
End If
%>

You can see that he commented "Do this" and "Do that". Problem is that
I didn't know that a single apostrophe indicates a comment. I figured
they were part of the markup somehow so I just replaced "do this" and
"do that" with my own code, leaving the apostrophes in place. Of
course it didn't work. I inquired. He clarifed. I removed the
apostrophes and tried again only to get ASP error pages.

See, I didn't know that to return a string to the browser I had to
prefix my stirng with "response.write". Google led me to learn that
ASP commands were called objects, and then led me to the devguru.com
website, which has a very nice ASP reference.

I tried again using "response.write", enclosing my string in quotation
marks, but continued getting errors. The string I wished to enclose
contained quotation marks, as well, so the server reasonably assumed
that the second quotation mark was the end of the string and
terminated the line prematurely. I figured I had to escape the
quotation marks somehow so I tried the regular expressions method of
using a backslash. Didn't work. Back to Google for a VBScript
reference. Took only a few minutes to learn that I have to double up
characters to escape them. Tried it. Worked. Bob's your uncle.

I think I'll write a tutorial:
"Learn ASP with VBScript the hard way!"
:)


KZ

On Mon, 13 Feb 2006 18:00:53 -0500, "Murray *TMM*"
<forums@HAHAgreat-web-sights.com> wrote:

>What was your solution?

Murray *TMM*

2006-02-16, 6:51 pm

Nice. Thanks for this, Ken! I'm glad you were able to noodle through it!

--
Murray --- ICQ 71997575
Team Macromedia Volunteer for Dreamweaver
(If you *MUST* email me, don't LAUGH when you do so!)
==================
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
==================


"Ken Zenachon" <spamaddy1@yahoo.com> wrote in message
news:0q94v1h6rpc5c4p5bq7auprqo9gokcp7rm@4ax.com...[color=darkred]
> Hi, Murray,
>
> Glad you asked!
> After darrel's reply to this thread (that I use ASP logic) I posted a
> message on the sitepoint ASP forum, asking for someone to translate
> the SSI directive to ASP. Someone was kind enough to oblige me, but
> his reply assumed I knew something about VBScript. I didn't, but after
> 45 minutes of trial and error, logical deduction and intense
> Google-ing I learned enough to make my code work.
>
> Here's the sitepoint.com thread:
> http://www.sitepoint.com/forums/showthread.php?t=347141
>
> What's that? You want all the details? Well, I'd be delighted!
>
> Basically, the poster parroted my ambiguous conditional actions in his
> code, so where I asked for an eqivalent of:
> <!--#if expr="${DOCUMENT_URI} = /"home.html/"" -->
> do this
> <!-- #else -->
> do this
> <!--#endif -->
>
> He replied with:
> <%
> If Instr(Request.ServerVariables("SCRIPT_NAME"), "home.html") <> 0
> Then
> 'Do this
> Else
> 'Do that
> End If
> %>
>
> You can see that he commented "Do this" and "Do that". Problem is that
> I didn't know that a single apostrophe indicates a comment. I figured
> they were part of the markup somehow so I just replaced "do this" and
> "do that" with my own code, leaving the apostrophes in place. Of
> course it didn't work. I inquired. He clarifed. I removed the
> apostrophes and tried again only to get ASP error pages.
>
> See, I didn't know that to return a string to the browser I had to
> prefix my stirng with "response.write". Google led me to learn that
> ASP commands were called objects, and then led me to the devguru.com
> website, which has a very nice ASP reference.
>
> I tried again using "response.write", enclosing my string in quotation
> marks, but continued getting errors. The string I wished to enclose
> contained quotation marks, as well, so the server reasonably assumed
> that the second quotation mark was the end of the string and
> terminated the line prematurely. I figured I had to escape the
> quotation marks somehow so I tried the regular expressions method of
> using a backslash. Didn't work. Back to Google for a VBScript
> reference. Took only a few minutes to learn that I have to double up
> characters to escape them. Tried it. Worked. Bob's your uncle.
>
> I think I'll write a tutorial:
> "Learn ASP with VBScript the hard way!"
> :)
>
>
> KZ
>
> On Mon, 13 Feb 2006 18:00:53 -0500, "Murray *TMM*"
> <forums@HAHAgreat-web-sights.com> wrote:
>


Sponsored Links


Copyright 2003 - 2008 forum4designers.com  Software forum  Computer Hardware reviews