PDA

View Full Version : SSI and Dreamweaver


ff92k
04-09-2001, 12:18 PM
Does anyone know how to set up an SSI in dreamweaver 3?
I know you can set them up by just going "isert" then "server side includes"
but i dont know what to do after! Do i just make a page with text in it, then set it as the SSI page? Plz help me out ere!
thanks

prymal
04-09-2001, 12:39 PM
just add the code in by hand. you couldn't get any simpler than this. :)

i.e. <!--#include file="stuff.txt" -->

i doubt that it will pull the file from your hard drive to your editor, but once you ftp it over, it'll be fine.

hope that's what you're looking for.

Damian
04-09-2001, 01:01 PM
FF92K,

You need to create & save the include file. This can be .html, .shtml or whatever.

Then you need to insert the file using the "Insert SSI" option.

The new page's extension must be .shtml

then upload both files to your site.

If that doesn't work for you, you need to modify your .htaccess file in your public_html directory...I'll let you know how to do it if you need me to....


WackyMan

ff92k
04-09-2001, 05:31 PM
top stuff
thanks very much :)

ff92k
04-10-2001, 03:52 PM
Right....i have a problem, please can you help me out with it?
I make the page that has the SSI on it. Then i go and make an index page and go to "insert server side includes" So i click on that and then i click on te file that i wanted as much SSI. It then imports the file and keeps it as a SSI on my index page. But i then upload the thing and it comes up with just the SSI page, and not the index page. I also saved the index as shtm, so it's not that. What am i doing wrong?
Please help, i really need it
Thanks people
Ollie

Damian
04-10-2001, 04:30 PM
your post is a bit confusing :)....do you have both the include page and your index page saved as .shtml?

also, dumb question, but are both pages uploaded to the same directory?

the only thing i can think of is it may be an issue with your .htaccess file in your public_html directory.

if everything else checks out -- let us know. I'll post what I know about .htaccess then (i'm at work and short on time) :)

ff92k
04-10-2001, 04:53 PM
hehe
Right, the SSI page is saved at .html and the index page is saved as .shtml
they are both uploaded into the same directory!!!! lol!
and thats about it!
here is the dreamweaver help SSI file that i dont understand! but u might be able to !
It is quite long, put i will post it all



:


Editing a server-side include
Like library items, server-side includes are selected as a whole unit in the Document window. Unlike library items, the HTML source code contained in an include does not appear in the HTML Source inspector. Instead, the actual server instruction appears, looking like this:

<!--#include virtual="/uber/html/footer.html" -->
To edit the content associated with the included file, you must open the file.

To edit a server-side include:

1 Select the server-side include in either the Document window or the HTML Source inspector, and click Edit in the Property inspector.
The included file opens in a new Document window.
2 Edit the file; then save it.
The changes are immediately reflected in the current document and in any subsequent document you open that includes the file.



Using server-side includes
Server-side includes are instructions to the server to include the specified file in the current document. Because the processing of includes happens on the server, included content does not normally appear when you open a document locally in a browser. Dreamweaver, however, does display server-side includes, both in the Document window and browser preview window. To display included content, Dreamweaver uses a translator to mimic the way a server would process the include instructions.

Placing a server-side include in a document inserts only a reference to an external file. Dreamweaver displays the content of the external file in the Document window, making it easier to design pages, but you cannot edit this content directly in a document. To edit the content of a server-side include, you must directly edit the file that you're including. Any changes to the external file are automatically reflected in every document that includes it.

To insert a server-side include:

1 Choose Insert > Server-Side Include or click the SSI button on the Common panel of the Object palette.
2 In the dialog box that appears, click the folder icon to browse to a file, or type the path to the file you want to include. Then click OK.


Viewing server-side includes in Dreamweaver
By default, Dreamweaver processes all nonconditional server-side includes and displays them in the Document window.

To specify which files are processed or to turn off processing of server-side includes:

1 Choose Edit > Preferences > Translation.
2 Select Server-Side Includes from the list of translators.
3 Select one of the following options for translating server-side includes:
In All Files Is the default setting; leave this turned on to see the content of included files displayed in the Document window.
In No Files Turns off all processing of server-side includes in Dreamweaver.
In Files with Extensions Causes Dreamweaver to process server-side includes only in files that end in .stm, .html, .htm, .shtml, or .shtm.
In Files Matching One of These Expressions Causes Dreamweaver to scan the document for matches to the listed regular expressions; if any matches are found, Dreamweaver processes any server-side includes in the document.


Viewing server-side includes in Dreamweaver
By default, Dreamweaver processes all nonconditional server-side includes and displays them in the Document window.

To specify which files are processed or to turn off processing of server-side includes:

1 Choose Edit > Preferences > Translation.
2 Select Server-Side Includes from the list of translators.
3 Select one of the following options for translating server-side includes:
In All Files Is the default setting; leave this turned on to see the content of included files displayed in the Document window.
In No Files Turns off all processing of server-side includes in Dreamweaver.
In Files with Extensions Causes Dreamweaver to process server-side includes only in files that end in .stm, .html, .htm, .shtml, or .shtm.
In Files Matching One of These Expressions Causes Dreamweaver to scan the document for matches to the listed regular expressions; if any matches are found, Dreamweaver processes any server-side includes in the document.




And that i everything....If you can help me out it would be massively appretiated
Thank you for helping me :)
Ollie

Odium
04-10-2001, 07:05 PM
Having multiple sets of <html> and <body> tags can cause browsers to freak out sometimes using SSI. Try stripping out the aforementioned tags from your include file.

Damian
04-10-2001, 07:16 PM
i use dreamweaver 4 and am not having any problems with it.

you may need to edit your .htaccess file. First go into your control panel and see if there is one there. (file manager >> public_html)

If so, edit the file and add these lines :

AddType text/html .shtml
DirectoryIndex default.shtml


The first line adds the .shtml as a handler. The next line determines the page that will be accessed when you go to www.yourdomain.com. The file doesn't have to be called default, it can be called index or whatever you want.


If you dont have an .htaccess file in your public_html directory, you need to create one. To do so, open a text editor (like notepad if you use windows) and type in the above lines. Save it as htaccess.txt and upload to your public_html directory. YOU NEED TO UPLOAD THE FILE AS ASCII TEXT.
Then go into your control panel and rename the htaccess.txt file to .htaccess Also, set the permissions (chmod) on .htaccess to 644.

That should work...if you did something wrong along the way, you'll know pretty quickly. :)

Hope this helps

WackyMan

ff92k
04-11-2001, 08:48 AM
i've done all that, but it still dosent work...
I think i'm doing something wrong in dreamweaver itself. i am having trouble following the instructions...
this is where i get stuck:

1 Choose Insert > Server-Side Include or click the SSI button on the Common panel of the Object palette.
2 In the dialog box that appears, click the folder icon to browse to a file, or type the path to the file you want to include. Then click OK.


How do i create the SSI page itself? Do i just make it, then save it as .html? cause thats what i'm doing and it doesent seem to work.

because i go to "isert ssi" then it goes to something else....it doesent go to the dialog box
tell u what....i'll do a guide using screenshots, then you can tell me what i'm doing wrong

First off this is my page :
http://www.futureff.com/example1.jpg

This is where i start


i then go:


http://www.futureff.com/example2.jpg

to insert the SSI


after i have clicked on server side includes
this screen comes up

http://www.futureff.com/example3.jpg

i then choose the file that i want to be my navigation bar (or SSI) (this is just an example) and it is saved as .htm
I insert the file (ssi)

So it looks like this:

http://www.futureff.com/example4.jpg

so that is my main page along with the SSI offline (the SSI is the white line on the left and the HTML text up the top)


i then upload both the files (the SSI and the main page)
(both in the same directory) and the main page is .shtm and the ssi is .htm

and when i got to look at it on the net it looks like this:

http://www.futureff.com/example5.jpg


it comes up...but without the SSI, and i have change the mod settings things too....anyone know what i'm doing wrong? thanks

Damian
04-11-2001, 01:35 PM
From what I could tell from the DW screen shots...your problem may be caused by the <head>, <body> & <html> tags....usually if you have a misplaced tag (or don't close a tag right) DW will flag that in the layout page.

you may also want to name both the SSI and your normal page .shtml -- and make sure that it's declared in the .htaccess file.....

Can you post links to your shtml pages so that we can look at them -- and hopefully be able to point out a solution?

ff92k
04-11-2001, 03:05 PM
what do you mean by "declared in the htaccess file" i have created it, but what do you mean declared? and if needed, i coul give you my control panel info (only you) so you could check it all out....tell me what u think

Damian
04-11-2001, 03:19 PM
yeah I can take a look at it...it may not be until tonight that I get a chance, though. My work connection is terribly slow with the control panel and times out often...this is not HR's fault...it's my employer's :)

anyhow, if you feel comfortable, email me at wackyman (at) disconnectsouth.com with the pages you are having trouble with and all the login/password info....

another way to handle this to where I dont have to go into your CP would be to post the links to the SSI and the normal page, and also a copy of your .htaccess file.

but either way is cool with me.

Wacky

ff92k
04-11-2001, 03:37 PM
dude! i worked it out! and tested it! it works!!!
yay!!!
check it out...this is just a stupid little test

http://www.futureff.com/ssitest.shtm

Damian
04-11-2001, 03:50 PM
sweet! does that mean you're all set?

ff92k
04-11-2001, 04:06 PM
yea man!
all ready!:D
thanks for all ya help


i'm so happy i think i'll post up my instruction for SSI!
lol!



here we go!



Steps to SSI


first off :: make SSI page

Secondly :: get HTML for SSI page (windows then HTML Source)

thirdly :: paste HTML code into notepad

fouth :: go to new page

fith :: so "isert SSI"

sixth :: find the text document u saved it as (the HTML code)

seventh :: click "ok to insert the SSI as a bit of HTML

eigth :: find the little HTML code tag in dreamweaver

ninth :: check everything is OK

tenth :: upload SSI page and other pages with the SSI on them

eleventh :: Test it

twelth :: let people enjoy!

ff92k
04-11-2001, 05:51 PM
i now have another problem
How do i change the route directory for the site?
Cause, it changed somehow, and now it's not reading the files in any other directories, cause i deleted the main directory by accident (doh) So i just need to change the route directory....how ya do it?

Damian
04-11-2001, 06:35 PM
you mean public_html?

if you did that...i dont know..it may be as easy as creating a directory (mkdir) in an FTP program....

or you may need to submit a trouble ticket...not too familiar with unix servers...sorry :(

ff92k
04-12-2001, 05:39 AM
nah....the route directory in dreamweaver

Damian
04-12-2001, 10:49 AM
In DW4 you can designate sites....I think it's under tools or something like that....sorry if that doesnt help

ff92k
04-12-2001, 11:40 AM
i'm stuck with old dreamweaver 3