SSI pros and cons?
Whether you're a seasoned veteran or a struggling beginner, Web Radiance is the web development and web design forum for you. You'll find answers to all your HTML, CSS, SEO, and Programming needs. Pull up a chair and stay awhile.
SSI pros and cons?
#1
Posted 18 May 2008 - 07:14 PM
http://www.yourhtmls...t/includes.html
I always assumed that it was necessary to use PHP or some other
server based scripting language to implement "includes" for common
page elements like navigation.
At least now I know why some pages have .shtml file extension type (although I dont see many of these).
I was wondering what are the pros and cons of using SSI versus
doing the same thing in PHP?
For example page load performance, search engine visibility , validation and so on.
#2
Posted 18 May 2008 - 07:40 PM
#3
Posted 19 May 2008 - 02:58 AM
Other than that, no problem at all with them.
Although I am curious, having never used them (I use php includes since I am a php guy), is the .shtml extension required to be able to use SSI?
<a href="http://www.dudes-japan.com" target="_blank">Dudes Japan</a>
#4
Posted 19 May 2008 - 03:03 AM
#5
Posted 19 May 2008 - 03:35 AM
At a very minimum I always use server side languages with my CSS menus to throw a "class='current'" onto the LI for the page the user is on, which you couldn't do with SSI.
#6
Posted 19 May 2008 - 05:47 AM
#7
#8
Posted 20 May 2008 - 03:16 AM
Give the body tag on each page an id.
<body id="home">
Give each button a class or id. So you declare the style for the button on all pages where it's not the current page
a.home
{
color: #000;
}
Then you also declare the style for the specific page, using the identifier in the body tag
#home a.home
{
color: #FFF;
}
Do this for each button, and they will all have a different state when they are current!
<a href="http://www.dudes-japan.com" target="_blank">Dudes Japan</a>
#9
Posted 20 May 2008 - 05:39 AM
And it means that if you have lots of tabs/selections then you'll end up with lots of CSS declarations that only apply to one page each?
#10
Posted 20 May 2008 - 06:13 AM
Sirkent, on May 20 2008, 05:39 AM, said:
And it means that if you have lots of tabs/selections then you'll end up with lots of CSS declarations that only apply to one page each?
There's nothing changing dynamically. The method that haku wrote about, which is the one I was referring to, assumes you have a unique body element on each page (or, at least, each page you have a nav-link for) ... I know that some of us prefer to have www.site.com/index.php?pagename, and in that case, yeah, you're likely using the same physical body element for every page...
So, again, in a site that truly has a unique body element per page, you give it a unique, unchanging ID. Then, you give each nav item a unique class name (unshared, contrary to what a class is used for). Then, like haku mentioned, your css contains something like this, which represents a style to render when a person hits a page, showing them "You are here":
#aboutPage .aboutLink,
#contactPage .contactLink,
#shopPage .shopLink,
etc. etc.,
etc. etc. {
color: #fc9; /* Change the color of the specific nav text to orange, only when the visitor hits the page represented by the nav text */
}
#11
Posted 20 May 2008 - 07:05 AM
#12
Posted 20 May 2008 - 08:36 AM
body#aboutUsPage h1 {color:blue;}
Also, and quite obviously, the css-method affords people with static html websites to achieve the same 'you-are-here' effect.
#13
Posted 20 May 2008 - 08:20 PM
I can see advantages in both methods, but the biggest one would be, as herk says, that people with static sites and/or no programming background whatsoever, can still achieve something that shows pages to be current.
As a side note, I love this talk of theory and discussing methods etc.
<a href="http://www.dudes-japan.com" target="_blank">Dudes Japan</a>
#14
Posted 20 May 2008 - 11:44 PM
Not that I think it's a better or worse way, I think it more reflects a different preference between client-side and server-side developers. Karl and I do a lot of server code so that way seems more elegant to us.
#15
Posted 21 May 2008 - 06:41 AM
Then, then the designers and/or the client asked for unique bits to be put onto some pages and not others, style-wise, it was a pain in my ass to target a particular element without adding extraneous IDs/classes to the element in question. Likewise, when all of that stuff is put into one include, you're often having the visitor download more than he or she needs to, using up precious bandwidth (on a high-traffic site anyway). Often there will be CSS, JS, and even some meta elements that simply aren't necessary on every page, and those things shouldn't be in an include that is inserted into all pages.
Often, I tend to leave the following things out of include files:
- DOCTYPE
- HTML opening tag
- Head opening and closing tags
- Title element
- Description meta element
- Body opening element
#16
Posted 24 November 2008 - 03:12 AM
It's a quick and easy server side scripting language.
It works well with databases, file systems, images.
It has regular expression support.
It has extensive database support.
Cons
No namespaces
Global configuration parameters can change language semantics, complicating deployment and portability.
Plenty of special purpose forms, but insufficient general purpose forms. Can someone explain what "special purpose forms" are for me?
Lacks named parameters, which have to be simulated with associative arrays or other techniques. I miss named parameters.


Help
This topic is locked
MultiQuote














