Page 1 of 1

Using SSI with topstyle

Posted: Mon Jan 21, 2013 7:07 pm
by abwillingham
Is there a trick to getting SSI to work with classic ASP and topstyle? Got mappings setup no problem but SSI are completely ignored within topstyle.

Re: Using SSI with topstyle

Posted: Wed Jan 23, 2013 4:22 am
by TopStyle Support
Have you tried the "Server-Side Include" snippet? (available on the "Script" tab of the HTML toolbar).

SSI is server-side technology and as such mostly out of TopStyle's control. Assuming you have configured preview mappings, then things should "just work".

Re: Using SSI with topstyle

Posted: Wed Jan 23, 2013 8:15 pm
by SteelToad
Why is it necessary to set up preview mappings ?

I work on a copy of the site on the local pc.
I've got a (local) page that contains <!--#include file="~~head.html" --> (fails with #include virtual as well)
It should try to include the ~~head.html relative to the current document.

If I set up mapping for my local directory to use the website address, then all of my previews fail.

I realize that SSI is outside of TopStyle's control but it would seem an easy and useful addition

Re: Using SSI with topstyle

Posted: Thu Jan 24, 2013 1:15 am
by TopStyle Support
SteelToad wrote:Why is it necessary to set up preview mappings ?
Without preview mappings, TopStyle is previewing a LOCAL copy of the document you're editing (not a REMOTE copy of the document you're editing)
SteelToad wrote:If I set up mapping for my local directory to use the website address, then all of my previews fail.
Are you getting an error? If yes, what error? Please be more specific.

Re: Using SSI with topstyle

Posted: Thu Jan 24, 2013 8:05 am
by SteelToad
Without preview mappings, TopStyle is previewing a LOCAL copy of the document you're editing
YES, that is exactly the behavior I would like.

Editing a live site is not an option for me, so I replicate the entire site locally and work on that. I only refer to pages and files with relative addressing instead of by a full URL. If in my index.html I use <!--#include virtual="~header.html" --> , I want it to include the local ~header.html relative to the file I am editing.

Preview Mappings doesn't work for me because I'm not using a local web server, but a remote one.

If I map my local directory (w:/kscs) to the URL (http://kscs.info/), then I get a 404 even though index.html is present in both locations. I understand that the Mappings feature is meant for local mapping, so this doesn't surprise me.

Re: Using SSI with topstyle

Posted: Sun Jan 27, 2013 2:57 pm
by TopStyle Support
SteelToad wrote:Editing a live site is not an option for me, so I replicate the entire site locally and work on that.
You don't have to edit a live site. You can install a local web server, and then point preview mappings to http://localhost
SteelToad wrote:I only refer to pages and files with relative addressing instead of by a full URL. If in my index.html I use <!--#include virtual="~header.html" --> , I want it to include the local ~header.html relative to the file I am editing.
No problems here. Relative paths are OK with preview mappings.
SteelToad wrote:Preview Mappings doesn't work for me because I'm not using a local web server, but a remote one.
If you're using any server-side technology, then preview mappings are the way to go. Without preview mappings, you basically bypass your server technology (SSI, or ASP, or PHP, or whatever)
SteelToad wrote:If I map my local directory (w:/kscs) to the URL (http://kscs.info/), then I get a 404 even though index.html is present in both locations.
If you're getting a 404 then the URL is incorrect or your web server isn't running (have you tried the same URL in your web browser?)
SteelToad wrote:I understand that the Mappings feature is meant for local mapping, so this doesn't surprise me.
Server mappings are both for live site editing and local web server editing.

Re: Using SSI with topstyle

Posted: Sun Jan 27, 2013 4:31 pm
by SteelToad
TopStyle Support wrote:You don't have to edit a live site. You can install a local web server ...
I realize I could install a local web server, but for a couple of reasons, I'd really rather not. Again, I understand that SSI isn't really part of TopStyle editing, but it would be really nice if it could support it by reading in the include file when the tag is detected
TopStyle Support wrote:If you're getting a 404 then the URL is incorrect or your web server isn't running (have you tried the same URL in your web browser?) ---- Server mappings are both for live site editing and local web server editing.
In my W:/kscs/ I have index.html and ~header.html. My index.html contains "<!--#include virtual="~~header.html" -->"
The website and server are up and running.
Both w:/kscs/ and http://kscs.info/ contain the files index.html and ~~header.html
If I map W:\kscs\ to http://kscs.info/ I get a page not found. If I uncheck 'Use mappings when previewing' and refresh the page it works again.

Re: Using SSI with topstyle

Posted: Mon Jan 28, 2013 2:13 pm
by TopStyle Support
SteelToad wrote:If I map W:\kscs\ to http://kscs.info/ I get a page not found.
What happens when you open http://kscs.info/ in your web browser?

Re: Using SSI with topstyle

Posted: Mon Jan 28, 2013 2:51 pm
by SteelToad
I see the web page just like anyone else does.

I made a copy of the index.html and renamed it to index.txt if you want to take a look
http://kscs.info/index.txt

Re: Using SSI with topstyle

Posted: Tue Jan 29, 2013 12:49 am
by TopStyle Support
SteelToad wrote:I made a copy of the index.html and renamed it to index.txt if you want to take a look http://kscs.info/index.txt
I'm getting this: 404 Safari can’t open the page. Safari can’t open the page “http://kscs.info/index.txt” because the server where this page is located isn’t responding.

Re: Using SSI with topstyle

Posted: Wed Jan 30, 2013 9:39 am
by SteelToad
I'm guessing you're coming from outside of the US ? I've got some rather draconian firewall rules set up. If you'd like to email me an IP range, I'd be glad to punch a hole for you, or if you'd like I can email you back the files

Re: Using SSI with topstyle

Posted: Thu Jan 31, 2013 12:29 am
by TopStyle Support
I would like to reproduce your problem and investigate why preview mappings don't seem to work for you.