Skip to main content
Lightnin Dave
Participating Frequently
Oct 23, 2017 4:05 PM UTC
Answered

Code colour server side includes (ssi)

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

Er... that's it.

Win7 DW CC 2017

This topic is closed to new replies. Start a new post to keep the conversation going.
Jon Fritz
Jon FritzCorrect answer
Community Expert
Oct 24, 2017 12:59 PM UTC

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).

6 replies

Lightnin Dave
Participating Frequently
Oct 24, 2017 8:46 AM UTC

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" -->

Translate
Jon Fritz
Community Expert
Jon FritzCommunity ExpertCorrect answer
Community Expert
Oct 24, 2017 12:59 PM UTC

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).

Translate
Lightnin Dave
Participating Frequently
Oct 24, 2017 1:14 PM UTC

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.

Translate
Nancy OShea
Community Expert
Community Expert
Oct 23, 2017 6:42 PM UTC

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

Translate
Nancy O'Shea— Product User & Community Expert
Jon Fritz
Community Expert
Community Expert
Oct 23, 2017 6:55 PM UTC

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.

Translate
Jon Fritz
Community Expert
Community Expert
Oct 23, 2017 4:46 PM UTC

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

Translate