Comments on design parse files and other external scripts


(Ryan Archer) #1

I'm just wondering something. I can see how we are able to make comments in a Design File (Edit Parse Screen) so that browsers will not print the code in 'view source' or 'Inspector'.

That's cool, will be good step towards reducing the HTML code within the page. Using the following syntax:

<!--@@ Comment goes here @@-->

But....is it possible for this syntax to work on CSS and JS files as well? I'm already assuming it's not as they have their own comment syntax that is different from HTML comment syntax. I can't test the theory out right now as haven't yet upgraded to V5.1. Can anyone out there confirm it?

 

Also if using design content areas (nested content) for calling external scripts and css, can these 'helpers' have comments in them like the Design files and have the comments be removed from the 'front end'?

 

Cheers


(Nic Hubbard) #2

That comment style will work in CSS Design File assets since they are parsed like a Design Asset is. But JS files will not since they are just regular files.


(Bart Banda) #3

That syntax actually works for JS and CSS file assets as well when served via Matrix. 

 

In CSS and JS you would off course use /*@@ comment here @@*/


(Ryan Archer) #4

Ahhh... thanks Bart!