Greetings!

I have to change my footer. Let's say I have 10 pages. That means open, cut-n-paste, and close 10 times.

Is this how everyone does it?

Can I not create something in CSS and only just "call" it from the HTML?

Thanks, in advance!

< Steve >

No. CSS is only for styling, what you're thinking of perhaps is a server-side programming language, like PHP or ASP.NET.

ssi includes in shtml
includes in asp
includes in php
by far most people have common page elements in header footer menu sidebar includes

Thanks, guys.

Too avoid having to learn another language (PHP, Java, etc.), I opted for the SSI.

@almostbob: So, I read up on SSI. (Too bad I have to have so many extra files though...one for each set of lines that I want replicated on each page, right?)

When I ran a little test, it didn't work. So the tutorial recommended I contact my hosting service. I did. They said SSI was enabled for .shtml.

Any thoughts why the following lines don't work?
In two different locations in my default.htm (the first one didn't work...):

<!--#include file="test.shtml"-->

In a file labeled test.shtml in the same directory:

<!--#echo var="DATE_LOCAL"-->

Thanks!

Do appreciate your time and assistance!

< Steve >

A::
the server is set up to parse some file extensions for serverside commands
eg. setup to only process cgi shtml php asp to use includes in your default.htm page it would have to be renamed default.shtml, when you make the change, remember to change the href in links that point to the homepage
B:: the code that you want replicated is likely to be Header, footer, menu, ads if used, all those items are css positioned in each page, their position is set in the external css file
so if your include file has

<div class='header'>blka bla bla bal</div>
<div id='menu'><ul id='menu'><li>item</li><li>item</li><li>item</li><li>item</li><li>item</li></ul>
</div>
<div class='footer'>&copy;me | contact me | why me | why not</div>

and the css file is set

.header {top:0; bottom:auto; width:100%; position:fixed; z-index:10;}
.footer {top:auto; bottom:0; width:100%; position:fixed; z-index:10; }
#menu {list-style:none; /* bla bla style a ul to be a css menu didnt paste it  lazy */ }

the positions of the included items will be identical on each page, whether the include is first, last, or anywhare in the file
all your includes can be in a single file if you wish
or all the common includes in one file, and any specific items for a specific page, in other files

all codes just samples not tested

Thanks! default.shtml worked (of course, you said it would).

Guess I need to spend time fix-positioning my header, footer (I like yours), navi menus, bla, bla, bla. ;-) Right now they are positioned in the "natural flow" of the pages.

So-o-o-o, stating the obvious: I would put the include line in the html above the first occurrence of any of the common elements...right?

You mentioned asp and php earlier. I s'pose java is in there, too? Which should I start with to extend my basic html/css skills (and I use the term loosely). Time to learn more!

Thanks, almostbob!

< Steve >

the next logical development is php, ssi on steroids,& a gazillion apps code samples downloadable scripts, a half a gazillion IDEs so you can test, free for the download
but it depends on the host, if you have a MS host asp is the one, most hosts are nix of some sort, apache so php is installed
php & mysql, or asp sql both work, different approach, same result

none of the pages of this site exist as hard coded files and google shows a million results, generated by php and dont really exist, but are searchable and linkable et al, and customize on what the visitor searches for
DaniWeb runs on a script vBulletin I think
Wordpress & a heap of others
much easier than hand coding anything, even if you just use the ideas, there is proven logic to use

HeadSlap moment,RE: natural flow,, screws up more web pages than you could imagine, each browser interprets natural completely differently, what looks cool on the development pc, looks wierd on others becuase each browser renders the layout on its own, IE puts margins on the inside, FF puts margins on the outside, safari does something different again, tell them what you want it to look like, they screw up less, and you get a consistent(not identical but recognizable) design

*HeadSlap Mmoment:noun; sudden enlightenment, assault excluded, see also Doh moment; I HATE overhead lightbulbs :P

Thanks, almostbob.

Wow! Whole bunches of stuff...

Been studying the possibilities/functions of SSI. Whole bunches of them, too!

Last question: How can I test SSI on my PC before I put it live on the site?

Appreciate all of the help! I know it takes time.

Thank you!

< Steve >

I dunno, there are heaps of IDEs that support dozens of languages, which ones support shtml have dropped out ouf sight because asp and php do everything ssi does, and more so ssi has been ignored
NetBeans though supports everything else, so may be a place to start for ssi
I have WAMP installed on my pc and it will parse .shtml files as they should be on the localhost, so WAMP may be a possiblility

Cool. Got it.

I looked before I posted - and after as well... Then I saw that by making a few configuration changes, DreamWeaver will allow you to preview the SSI files as well as WAMP.

You've been a BIG help! Thank you very much!!

Consider this closed.

< Steve >

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.