Copy link to clipboard
Copied
So I understand that the insert menu has been changed in CS6 and then again in CC (Dreamweaver 12.2).
http://helpx.adobe.com/dreamweaver/using/changes-insert-options-creative-cloud.html
I am using DW CC. I want to insert HTML comments quickly in a bunch of different locations in my page code. Is there a way to do that?
If this must now be done by hand I would like to know why. The reason for the changes is explained as removing support for deprecated elements, but HTML comments are not deprecated in HTML 5.
http://www.w3.org/html/wg/drafts/html/master/syntax.html#comments
1 Correct answer
There is another option. Select the block of the code and choose the comment option as per your requirement. See image below.
Copy link to clipboard
Copied
There is another option. Select the block of the code and choose the comment option as per your requirement. See image below.
Copy link to clipboard
Copied
That is helpful - thank you!
Why would it be a toolbar option but not a menu option? Just to leave things uncluttered?
Copy link to clipboard
Copied
This has been there from many versions.
I consider having it in menu was not so useful for me when I can have it just next to where I am coding.
Copy link to clipboard
Copied
I think Adobe is attempting to make the insert menus less cluttered.
Don't forget to use the Snippets folder for storing and inserting re-usable code bits. Also, the insert panel has a Favorites Tab so you can customize it with your most used items.
Nancy O.
Copy link to clipboard
Copied
except that "HTML Comments" isn't one of the options for the Favorites menu.
C'mon, it's not like "comments, who uses them any more?" Putting that back on the menu under what I recall as an HTML section wouldn't make the menu any more cluttered than it already is.
Copy link to clipboard
Copied
I remember back in the good old homesite days you could press shift-ctrl-m and get a comment around the block of code you have selected that would be appropriate to the code (html, css, javascript). I have no idea why this was ever removed.
Copy link to clipboard
Copied
Adding comments to your DW custom Snippets folder is easy.
Reuse code with Code Snippets | Adobe Dreamweaver CC tutorials
And you can associate your Snippets with custom keyboard shortcuts.
Dreamweaver Help | Keyboard shortcuts
Nancy O.
Copy link to clipboard
Copied
Thanks Nancy but I was talking specifically about one command that would wrap the selected text with comment delimiters appropriate to the language of the code you're currently editing.
Copy link to clipboard
Copied
In DW CC Code View or the Code Inspector panel, there's a tool bar icon for inserting comments. See screenshots.
Nancy O.
Copy link to clipboard
Copied
Thanks again Nancy but I was talking specifically about one command that would wrap the highlighted content in comments. Navigating through a menu to make a selection would take longer than just adding the appropriate delimiters.
In Homesite there was a command "Shift-Ctrl-M" that would insert the correct comments (in html it would add <!-- --> and in css and javascript it would add /* */).
It's a small thing but I used it all the time. Nowadays I map the html comment to that keystroke since that's the one I use the most but it would still be nice if dreamweaver just had a context-aware comment command.
Copy link to clipboard
Copied
Feel free to use the official Feature Request Form. If enough people suggest the same idea, it might be added to a future release.
Feature Request/Bug Report Form
Nancy O.
Copy link to clipboard
Copied
You can use the Snippets panel to do exactly that, add an html comment around a selection using a keyboard shortcut, here's how...
1. Click the + on the bottom of the Snippet Window
2. For Name, put in HTML Comment
3. Make sure the "Wrap Selection" radio button is chosen
4. For "Insert before" enter: <!--
5. For "Insert after" enter: -->
6. Hit OK
7. Go to Edit > Keyboard Shortcuts
8. In the Commands dropdown, go to Snippets
9. Browse to your newly created custom Snippet and click to highlight it
10. Click in the Press key field and hit your key combo, for example: Ctrl + Shift + \ (not set in the default shortcuts)
11. Hit OK.
From there on out, when you make a selection and hit that shortcut, the selection will be wrapped in html comment tags from Code or Design Views.
Copy link to clipboard
Copied
Thanks but my issue is that if I'm editing a javascript or css file then I need different comments delimiters inserted. I could map /* */ to a different command but it just seems more natural to have one command that will insert the correct comments based on the language of the code that's being edited.
Copy link to clipboard
Copied
Aside from the Feature Request form Nancy pointed out, another route to get to the dev team would be to start an Idea over here: Dreamweaver Ideas and getting enough votes that Adobe adds the function to the program (which has happened in the recent past).
Until then, you're pretty much stuck using Snippets with Shortcuts, the Add Comment menu in the Code View sidebar or manually adding them.
Copy link to clipboard
Copied
Using keyboard shortcuts,
in command "menu", select "Modify Code", and then choose "Apply HTML comment".
(i don't know if the names are translated correctly, because i'm using the italian version of the program)

