This is Interesting: Free Magazines for Graphics designers and webmasters  


Home > Archive > Webmaster forum > July 2006 > SSI questions





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 SSI questions
Sally Thompson

2006-07-10, 7:18 pm

I've finally decided I really must put my menus into SSI files, and having
read the tutorials and experimented a bit, can't believe how easy it is and
why I haven't done it before. However I have two questions:

At present I give a visual indication of the current page by using
id="current" in the menu and marking it up with CSS. I can do this in my
included file okay, by using <body id="foo1"> and suitable ids in the menu
list so that it reads something like
<ul>
<li><a href="one.shtml" id="one">Home Page</a></li>
<li><a href="two.shtml" id="two">Item Two</a></li>
</ul>
and then marking up the changes in the css with #foo1 a#one {...}.

(My sample file is on <http://www.sallysweb.co.uk/sallysmenu.shtml> if you
need to see what I mean.) This is working as I expect, but I currently also
remove the live link from the current page and by using the above method, the
current page still shows as a live link. Is there any way to achieve this on
an included file?

My second question is that I have to change all existing files from foo.html
to foo.shtml. How best can I ensure that anyone who has these specific pages
bookmarked will get redirected to the new page(s)? I assume there is a way
to automate this but would appreciate answers which are not too complicated!





--
Sally in Shropshire, UK
bed and breakfast near Ludlow: http://www.stonybrook-ludlow.co.uk
Burne-Jones/William Morris window in Shropshire church:
http://www.whitton-stmarys.org.uk

CJM

2006-07-10, 7:18 pm


"Sally Thompson" <me2@privacy.net> wrote in message
news:0001HW.C0C84CDC017FE08CF0407530@news.individual.net...
> (My sample file is on <http://www.sallysweb.co.uk/sallysmenu.shtml> if you
> need to see what I mean.) This is working as I expect, but I currently
> also
> remove the live link from the current page and by using the above method,
> the
> current page still shows as a live link. Is there any way to achieve this
> on
> an included file?
>


Have a look at
this:http://www.tjkdesign.com/articles/n...nt_location.asp

I like the contectual selectors, but I can see the authors point about
maintenance...

> My second question is that I have to change all existing files from
> foo.html
> to foo.shtml. How best can I ensure that anyone who has these specific
> pages
> bookmarked will get redirected to the new page(s)? I assume there is a
> way
> to automate this but would appreciate answers which are not too
> complicated!
>


Before you do anything, confirm that your web server *does* require you to
use shtml files... I use IIS, which doesn't. I'm afraid I dont know much
about other serves, other than some require shtml and some don't...


CJM


CJM

2006-07-10, 7:18 pm

Off the top of my head, I can think of a better way...

In the menu file, give each menu item a unique ID:

<li><a id="home" href="/">Home</a></li>
<li><a id="about" href="/about_us.htm">About Us</a></li>
<li><a id="contact" href="/contact_us.htm">Contact Us</a></li>
<li><a id="services" href="/our_services.htm">Our Services</a></li>

Style standard links in the CSS file...

But override the styling for the current page link by specifying a different
syle in the main page header:

<head>
<link rel="stylesheet" href="mystyles.css">
<link rel="stylesheet" href="services.css">
</head>

or

<head>
<link rel="stylesheet" href="mystyles.css">
<style>
li a#services {color: red;}
</style>
</head>

This, of course, comes with all the usual caveats, because it's completely
untested.

Chris


Sally Thompson

2006-07-10, 7:18 pm

On Wed, 28 Jun 2006 15:38:33 +0100, CJM wrote
(in article <4gfij9F1msucbU1@individual.net> ):

>
> "Sally Thompson" <me2@privacy.net> wrote in message
> news:0001HW.C0C84CDC017FE08CF0407530@news.individual.net...
>
> Have a look at
>

this:http://www.tjkdesign.com/articles/n...rent_location.a

> sp


Thanks for a useful link, but this technique is using javascript. I know
zero about javascript <g> so would it work if a visitor had it disabled?

>
> Before you do anything, confirm that your web server *does* require you to
> use shtml files... I use IIS, which doesn't. I'm afraid I dont know much
> about other serves, other than some require shtml and some don't...


Well, I ran the little test on
<http://www.freewebmasterhelp.com/tutorials/ssi> and when I saved the file
and uploaded it as html, nothing showed. When I resaved it as shtml, there
it was, so I assume I *do* need to use them.

--
Sally in Shropshire, UK
bed and breakfast near Ludlow: http://www.stonybrook-ludlow.co.uk
Burne-Jones/William Morris window in Shropshire church:
http://www.whitton-stmarys.org.uk

Sally Thompson

2006-07-10, 7:18 pm

On Wed, 28 Jun 2006 15:51:16 +0100, CJM wrote
(in article <4gfjb4F1mo2hrU1@individual.net> ):

> Off the top of my head, I can think of a better way...
>
> In the menu file, give each menu item a unique ID:
>
> <li><a id="home" href="/">Home</a></li>
> <li><a id="about" href="/about_us.htm">About Us</a></li>
> <li><a id="contact" href="/contact_us.htm">Contact Us</a></li>
> <li><a id="services" href="/our_services.htm">Our Services</a></li>
>
> Style standard links in the CSS file...
>
> But override the styling for the current page link by specifying a different
> syle in the main page header:
>
> <head>
> <link rel="stylesheet" href="mystyles.css">
> <link rel="stylesheet" href="services.css">
> </head>
>
> or
>
> <head>
> <link rel="stylesheet" href="mystyles.css">
> <style>
> li a#services {color: red;}
> </style>
> </head>
>
> This, of course, comes with all the usual caveats, because it's completely
> untested.




That looks like an interesting possibility Chris. I will go off and
experiment.



--
Sally in Shropshire, UK
bed and breakfast near Ludlow: http://www.stonybrook-ludlow.co.uk
Burne-Jones/William Morris window in Shropshire church:
http://www.whitton-stmarys.org.uk

CJM

2006-07-10, 7:18 pm


"Sally Thompson" <me2@privacy.net> wrote in message
news:0001HW.C0C85F1F018427DDF0407530@news.individual.net...
>
> Thanks for a useful link, but this technique is using javascript. I know
> zero about javascript <g> so would it work if a visitor had it disabled?
>


It would degrade gracefully, which is all you can ask for really...


Sally Thompson

2006-07-10, 7:18 pm

On Wed, 28 Jun 2006 16:37:18 +0100, CJM wrote
(in article <4gfm1eF1n5oemU1@individual.net> ):

>
> "Sally Thompson" <me2@privacy.net> wrote in message
> news:0001HW.C0C85F1F018427DDF0407530@news.individual.net...
>
> It would degrade gracefully, which is all you can ask for really...
>
>



Ah - OK. Thanks a lot.



--
Sally in Shropshire, UK
bed and breakfast near Ludlow: http://www.stonybrook-ludlow.co.uk
Burne-Jones/William Morris window in Shropshire church:
http://www.whitton-stmarys.org.uk

Brian Wakem

2006-07-10, 7:18 pm

Sally Thompson wrote:
> On Wed, 28 Jun 2006 15:38:33 +0100, CJM wrote
> (in article <4gfij9F1msucbU1@individual.net> ):
>
> this:http://www.tjkdesign.com/articles/n...rent_location.a
>
>
> Thanks for a useful link, but this technique is using javascript. I know
> zero about javascript <g> so would it work if a visitor had it disabled?
>
>
> Well, I ran the little test on
> <http://www.freewebmasterhelp.com/tutorials/ssi> and when I saved the file
> and uploaded it as html, nothing showed. When I resaved it as shtml, there
> it was, so I assume I *do* need to use them.



You probably just need to configure the web server correctly.

In Apache you would probably have this by default:

AddType text/html .shtml
AddOutputFilter INCLUDES .shtml

Just add:

AddOutputFilter INCLUDES .html


--
Brian Wakem
Email: http://homepage.ntlworld.com/b.wakem/myemail.png



Sally Thompson

2006-07-10, 7:18 pm

On Wed, 28 Jun 2006 17:16:46 +0100, Brian Wakem wrote
(in article <4gfobeF1n70d4U2@individual.net> ):

> Sally Thompson wrote:
[color=darkred]
>
>
> You probably just need to configure the web server correctly.
>
> In Apache you would probably have this by default:
>
> AddType text/html .shtml
> AddOutputFilter INCLUDES .shtml
>
> Just add:
>
> AddOutputFilter INCLUDES .html
>
>
>


Thank you! That looks easier than redirecting or renaming all pages.

--
Sally in Shropshire, UK
bed and breakfast near Ludlow: http://www.stonybrook-ludlow.co.uk
Burne-Jones/William Morris window in Shropshire church:
http://www.whitton-stmarys.org.uk

SmakDaddy

2006-07-10, 7:18 pm


"Sally Thompson" <me2@privacy.net> wrote in message
news:0001HW.C0C878D10189FAB1F0407530@news.individual.net...
> On Wed, 28 Jun 2006 17:16:46 +0100, Brian Wakem wrote
> (in article <4gfobeF1n70d4U2@individual.net> ):
>
>
specific[color=darkred]
a[color=darkred]
you to[color=darkred]
much[color=darkred]
file[color=darkred]
there[color=darkred]
>
> Thank you! That looks easier than redirecting or renaming all pages.
>



Add this to your .htaccess file

AddType text/html .shtml .shtm .htm .html
AddHandler server-parsed .shtml .shtm .htm .html

Done deal.


Sally Thompson

2006-07-10, 7:18 pm

On Wed, 28 Jun 2006 19:34:18 +0100, SmakDaddy wrote
(in article <12a5it9nsf6g5ea@corp.supernews.com> ):

>
> "Sally Thompson" <me2@privacy.net> wrote in message
> news:0001HW.C0C878D10189FAB1F0407530@news.individual.net...
> specific
> a
> you to
> much
> file
> there
>
>
> Add this to your .htaccess file
>
> AddType text/html .shtml .shtm .htm .html
> AddHandler server-parsed .shtml .shtm .htm .html
>
> Done deal.
>
>


Well you're the one who should know. Let's just say that if it doesn't work,
MIS might be getting a support query :-)

Thanks very muchly.



--
Sally in Shropshire, UK
bed and breakfast near Ludlow: http://www.stonybrook-ludlow.co.uk
Burne-Jones/William Morris window in Shropshire church:
http://www.whitton-stmarys.org.uk

SmakDaddy

2006-07-10, 7:18 pm


"Sally Thompson" <me2@privacy.net> wrote in message
news:0001HW.C0C8A348018CBB65F0407530@news.individual.net...
> On Wed, 28 Jun 2006 19:34:18 +0100, SmakDaddy wrote
> (in article <12a5it9nsf6g5ea@corp.supernews.com> ):
>
is[color=darkred]
>
> Well you're the one who should know. Let's just say that if it doesn't

work,
> MIS might be getting a support query :-)
>
> Thanks very muchly.


LOL

All it does is allow ssi parsing in html without you having to rename.



Charles Sweeney

2006-07-10, 7:18 pm

Sally Thompson wrote

> I've finally decided I really must put my menus into SSI files


Golly, people still use them?

--
Charles Sweeney
http://CharlesSweeney.com
Nikita the Spider

2006-07-10, 7:18 pm

In article <0001HW.C0C878D10189FAB1F0407530@news.individual.net>,
Sally Thompson <me2@privacy.net> wrote:> > You probably just need to
configure the web server correctly.
>
> Thank you! That looks easier than redirecting or renaming all pages.


Hi Sally,
The solution given above is indeed quick and effective, and I don't have
any criticism of it, but I do have a caveat. And now, a word from the
Devil's Advocate Dept: you might be aware of this already, but in case
you're not I want to point out that this is a performance hit for your
Web server. By adding this line --
AddOutputFilter INCLUDES .html
-- you're telling Apache to scan each HTML file for SSI instructions.
Without that line, Apache can just blast each HTML file straight onto
the wire (more or less) in response to an HTTP request. With that line
added, Apache has to scan the file (looking for SSI instructions) before
sending it out.

Obviously I'm not in a position to tell you whether or not this is
significant for you. If your Web server is already working pretty hard,
this won't help matters and if 99% of your HTML files have no SSI
instructions in them, then it might make sense to just rename the other
%1 to .shtml. OTOH if you Web server has no load problems and you've got
SSIs in almost every file, this is an excellent solution.

HTH

--
Philip
http://NikitaTheSpider.com/
Bulk HTML validation, link checking and more
Sally Thompson

2006-07-10, 7:19 pm

On Thu, 29 Jun 2006 03:32:46 +0100, Nikita the Spider wrote
(in article
<NikitaTheSpider-4843F5.22325228062006@news-rdr-03-ge0-1.southeast.rr.com> ):

> In article <0001HW.C0C878D10189FAB1F0407530@news.individual.net>,
> Sally Thompson <me2@privacy.net> wrote:> > You probably just need to
> configure the web server correctly.
>
> Hi Sally,
> The solution given above is indeed quick and effective, and I don't have
> any criticism of it, but I do have a caveat. And now, a word from the
> Devil's Advocate Dept: you might be aware of this already, but in case
> you're not I want to point out that this is a performance hit for your
> Web server. By adding this line --
> AddOutputFilter INCLUDES .html
> -- you're telling Apache to scan each HTML file for SSI instructions.
> Without that line, Apache can just blast each HTML file straight onto
> the wire (more or less) in response to an HTTP request. With that line
> added, Apache has to scan the file (looking for SSI instructions) before
> sending it out.


Thanks for the info. Smak Daddy has now posted a different solution, and
since he works for my host I imagine this is the one to go for<g>.

It's been interesting reading the different replies.

--
Sally in Shropshire, UK
bed and breakfast near Ludlow: http://www.stonybrook-ludlow.co.uk
Burne-Jones/William Morris window in Shropshire church:
http://www.whitton-stmarys.org.uk

Sally Thompson

2006-07-10, 7:19 pm

On Thu, 29 Jun 2006 01:14:38 +0100, Charles Sweeney wrote
(in article <Xns97F1CACBB3FBmecharlessweeneycom@130.133.1.4> ):

> Sally Thompson wrote
>
>
> Golly, people still use them?
>
>


<blush>Have I shown my ignorance yet again? What should I be using?



--
Sally in Shropshire, UK
bed and breakfast near Ludlow: http://www.stonybrook-ludlow.co.uk
Burne-Jones/William Morris window in Shropshire church:
http://www.whitton-stmarys.org.uk

Matt Probert

2006-07-10, 7:19 pm

On Thu, 29 Jun 2006 14:08:37 +0100, Sally Thompson <me2@privacy.net>
wrote:

>On Thu, 29 Jun 2006 01:14:38 +0100, Charles Sweeney wrote
>(in article <Xns97F1CACBB3FBmecharlessweeneycom@130.133.1.4> ):
>
>
><blush>Have I shown my ignorance yet again? What should I be using?
>


Ha! You should worry.

I worked in an office where one middle-aged, married man announced
"why on earth should anyone want flavoured condoms?"

And *you* worry about being ignorant???

Matt


--
Veritas Vincti
http://www.probertencyclopaedia.com
Sally Thompson

2006-07-10, 7:19 pm

On Thu, 29 Jun 2006 14:39:23 +0100, Matt Probert wrote
(in article <44a3d7d5.13899406@news.freenetname.co.uk> ):

> On Thu, 29 Jun 2006 14:08:37 +0100, Sally Thompson <me2@privacy.net>
> wrote:
>
>
> Ha! You should worry.
>
> I worked in an office where one middle-aged, married man announced
> "why on earth should anyone want flavoured condoms?"
>
> And *you* worry about being ignorant???




LOL. Did anyone tell him? I well remember wanting to dive under the carpet
when, aged about 20, I wanted to use the word organism, but the word orgasm
popped out by mistake :-)




--
Sally in Shropshire, UK
bed and breakfast near Ludlow: http://www.stonybrook-ludlow.co.uk
Burne-Jones/William Morris window in Shropshire church:
http://www.whitton-stmarys.org.uk

GreyWyvern

2006-07-10, 7:19 pm

And lo, Sally Thompson didst speak in alt.www.webmaster:

> Matt Probert wrote:
>
>
> LOL. Did anyone tell him? I well remember wanting to dive under the
> carpet
> when, aged about 20, I wanted to use the word organism, but the word
> orgasm
> popped out by mistake :-)


I remember seeing a montage somewhere of partially inebriated people at
weddings wishing the Bride and Groom "great success", but having "great
sex" come out instead. :)

Grey

--
The technical axiom that nothing is impossible sinisterly implies the
pitfall corollary that nothing is ridiculous.
- http://www.greywyvern.com/orca#search - Orca Search: Full-featured
spider and site-search engine
Charles Sweeney

2006-07-10, 7:20 pm

Sally Thompson wrote

> On Thu, 29 Jun 2006 01:14:38 +0100, Charles Sweeney wrote
> (in article <Xns97F1CACBB3FBmecharlessweeneycom@130.133.1.4> ):
>
>
> <blush>Have I shown my ignorance yet again? What should I be using?


You should be using whatever does the job for you. If that's SSIs then use
them!

It seems to me that people today are more turning to the likes of PHP or
ASP for performing tasks.

--
Charles Sweeney
http://CharlesSweeney.com
Sally Thompson

2006-07-10, 7:20 pm

On Sat, 8 Jul 2006 11:17:20 +0100, Charles Sweeney wrote
(in article <Xns97FA72E613CEAmecharlessweeneycom@130.133.1.4> ):

> Sally Thompson wrote
>
>
> You should be using whatever does the job for you. If that's SSIs then use
> them!
>
> It seems to me that people today are more turning to the likes of PHP or
> ASP for performing tasks.
>
>


Thanks. I've looked at PHP and gone through some of the tutorials, but SSIs
seem *very* simple in comparison. Not enough time to really study PHP at the
moment I suppose - it's on my to-do list.





--
Sally in Shropshire, UK
bed and breakfast near Ludlow: http://www.stonybrook-ludlow.co.uk
Burne-Jones/William Morris window in Shropshire church:
http://www.whitton-stmarys.org.uk

Mark Goodge

2006-07-10, 7:20 pm

On Sat, 8 Jul 2006 22:10:59 +0100, Sally Thompson put finger to
keyboard and typed:

>On Sat, 8 Jul 2006 11:17:20 +0100, Charles Sweeney wrote
>(in article <Xns97FA72E613CEAmecharlessweeneycom@130.133.1.4> ):
>
>
>Thanks. I've looked at PHP and gone through some of the tutorials, but SSIs
>seem *very* simple in comparison. Not enough time to really study PHP at the
>moment I suppose - it's on my to-do list.


That's because SSIs *are* very simple in comparison - SSIs have only a
very limited range of possibilities, while PHP is a full-featured
programming language. But using PHP for a simple file include is just
as easy as doing it with SSI - you don't need to be a PHP programmer
to achieve that. And starting out by doing it with PHP means it's then
easy to expand to more complex use of the language later if you want
to. Starting with SSI will mean ditching it later if you want to do
anything more complex.

Mark
--
Blog: http://mark.goodge.co.uk Photos: http://www.goodge.co.uk
Sally Thompson

2006-07-10, 7:20 pm

On Sun, 9 Jul 2006 08:38:28 +0100, Mark Goodge wrote
(in article <8dc1b2hsr0cqctrpus20u5b3gsd3hbdmnk@news.markshouse.net> ):

> On Sat, 8 Jul 2006 22:10:59 +0100, Sally Thompson put finger to
> keyboard and typed:
>
>
> That's because SSIs *are* very simple in comparison - SSIs have only a
> very limited range of possibilities, while PHP is a full-featured
> programming language. But using PHP for a simple file include is just
> as easy as doing it with SSI - you don't need to be a PHP programmer
> to achieve that. And starting out by doing it with PHP means it's then
> easy to expand to more complex use of the language later if you want
> to. Starting with SSI will mean ditching it later if you want to do
> anything more complex.



Thanks for the pointer. You've provided the kick I needed (in the nicest
possible way) to get into PHP.



--
Sally in Shropshire, UK
bed and breakfast near Ludlow: http://www.stonybrook-ludlow.co.uk
Burne-Jones/William Morris window in Shropshire church:
http://www.whitton-stmarys.org.uk

Sponsored Links


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