Skip to main content
Lightnin Dave
Participating Frequently
October 23, 2017
Answered

Code colour server side includes (ssi)

  • October 23, 2017
  • 3 replies
  • 489 views

Is it possible to code colour server side includes (ssi)?

Er... that's it.

Win7 DW CC 2017

This topic has been closed for replies.
Correct answer Jon Fritz

What file extension are you using for the include file?

The extension .ssi isn't recognized by DW and will be white on black or black on white depending on your theme.

Changing the extension of the include to something DW recognizes will bring back code coloring (html,  shtml or php).

3 replies

Lightnin Dave
Participating Frequently
October 24, 2017

Thanks for responding.

Obviously I didn't think through my question thoroughly though.

What I mean is the html code in the ssi file itself. The ssi file, despite being just an html snippet, is displayed as white on black (in my particular theme) whereas a file ending html or shtml enjoys full colour niceness.

And not the include link to it which in my shtml file is just follows the commented out colour as normal.

e.g. <!--#include virtual="/includes/head.ssi" -->

Jon Fritz
Community Expert
Jon FritzCommunity ExpertCorrect answer
Community Expert
October 24, 2017

What file extension are you using for the include file?

The extension .ssi isn't recognized by DW and will be white on black or black on white depending on your theme.

Changing the extension of the include to something DW recognizes will bring back code coloring (html,  shtml or php).

Lightnin Dave
Participating Frequently
October 24, 2017

Aha! I never realised you could use different extension names with an include, so since... erm... a long time ago, I've always used .ssi That's the way I was taught.

A quick test to rename it an html file has done the trick.

Simple really. Many thanks for your help everyone.

Nancy OShea
Community Expert
Community Expert
October 23, 2017

I think it depends on which Code Color Theme you use.  In mine, PHP includes are pink and orange.

Nancy O'Shea— Product User & Community Expert
Jon Fritz
Community Expert
Community Expert
October 23, 2017

Ah, yeah, I guess when the OP said "server side includes (ssi)", I assumed they were talking about shtml includes like...

<!--#include virtual="/cgi-bin/counter.pl" -->

Which get picked up as comments.

PHP includes are controlled, at least in the theme I'm currently using, with the "cm-meta, .cm-m-clike.cm-meta" selectors.

Jon Fritz
Community Expert
Community Expert
October 23, 2017

They'll pick up whatever color is set for html comments as far as I've been able to tell in CC2017 and later. I don't know of a code-mirror selector that can change them specifically, but you can change the color of html comments within DWs main.less file though (which may be enough for you if you don't use a lot of html comments in your code).

1. Go to Edit > Preferences > Interface

2. Pick your Code Theme
3. Hit the + icon to duplicate it

4. Give the new theme a name and hit OK

5. Click the new theme in the list and hit the Edit button

6. Do a quick Find for "cm-comment"

7. Change the hex color for the comment and save

8. Go back to Edit > Preferences > Interface select your new theme and hit Apply