Using SSI with topstyle

TopStyle has been discontinued and support is no longer available. The forum is read-only. NOTE: TopStyle was not developed by the makers of CSS HTML Validator.
abwillingham
Rank 0 - Newcomer
Posts: 7
Joined: Thu Aug 23, 2012 9:15 am

Using SSI with topstyle

Post 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.
User avatar
TopStyle Support
Rank VI - Professional
Posts: 506
Joined: Sat Jun 13, 2009 12:38 pm

Re: Using SSI with topstyle

Post 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".
SteelToad
Rank I - Novice
Posts: 18
Joined: Thu Nov 29, 2012 8:37 pm

Re: Using SSI with topstyle

Post 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
User avatar
TopStyle Support
Rank VI - Professional
Posts: 506
Joined: Sat Jun 13, 2009 12:38 pm

Re: Using SSI with topstyle

Post 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.
SteelToad
Rank I - Novice
Posts: 18
Joined: Thu Nov 29, 2012 8:37 pm

Re: Using SSI with topstyle

Post 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.
User avatar
TopStyle Support
Rank VI - Professional
Posts: 506
Joined: Sat Jun 13, 2009 12:38 pm

Re: Using SSI with topstyle

Post 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.
SteelToad
Rank I - Novice
Posts: 18
Joined: Thu Nov 29, 2012 8:37 pm

Re: Using SSI with topstyle

Post 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.
User avatar
TopStyle Support
Rank VI - Professional
Posts: 506
Joined: Sat Jun 13, 2009 12:38 pm

Re: Using SSI with topstyle

Post 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?
SteelToad
Rank I - Novice
Posts: 18
Joined: Thu Nov 29, 2012 8:37 pm

Re: Using SSI with topstyle

Post 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
User avatar
TopStyle Support
Rank VI - Professional
Posts: 506
Joined: Sat Jun 13, 2009 12:38 pm

Re: Using SSI with topstyle

Post 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.
SteelToad
Rank I - Novice
Posts: 18
Joined: Thu Nov 29, 2012 8:37 pm

Re: Using SSI with topstyle

Post 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
User avatar
TopStyle Support
Rank VI - Professional
Posts: 506
Joined: Sat Jun 13, 2009 12:38 pm

Re: Using SSI with topstyle

Post by TopStyle Support »

I would like to reproduce your problem and investigate why preview mappings don't seem to work for you.