Operation Manual

Table Of Contents
397
Coding
Last updated 11/30/2015
Set up your computer for application development
Open Related Files
Code Navigator tutorial
Building Spry pages visually
Regular expressions
Search for and replace text
Regular expressions
Search for and replace text
Collapsing code
You can collapse and expand code fragments so that you can view different sections of your document without having
to use the scroll bar. For example, to see all of the CSS rules in the head tag that apply to a div tag farther down the page,
you can fold all the code between the head tag and the div tag so that you can see both sections of code at once.
You can select the portion of code to collapse it. You can also collapse code in HTML, PHP, XML, and SVG files based
on tag blocks. In CSS, LESS, Sass, SCSS, and JS files, you can collapse code based on curly braces.
HTML files: The code between an opening and closing HTML tag is collapsed and the initial attributes, wherever
applicable, are displayed in the collapsed code. The collapsed code block is auto expanded when the code within the
block receives focus through Tag Selector, Find & Replace, Go To Line, Element Quick View, Live View, or
Undo/Redo. Once the selection in these features changes, the code is automatically collapsed back again.
CSS, LESS, SASS, SCSS, and JS files: Code within curly brackets is collapsed and the preview is displayed as {...}.
PHP files: HTML elements, CSS, and JS code blocks are collapsed in addition to PHP code blocks. You can collapse
any PHP code block that begins with <?php and ends with ?>.
Note: Files created from Dreamweaver templates display all code as fully expanded, even if the template file (.dwt) contains
collapsed code fragments.
Collapse and expand code fragments
By default, all the code in Code view is in expanded mode. You can specify the minimum number of lines for code
folding in Preferences.
Note: The collapsed or expanded states of code blocks are retained across Dreamweaver sessions.
To collapse code based on tag blocks or curly braces, perform the following actions:
1 In Code view, hover your mouse over the line number column that corresponds to the code block you want to
collapse or expand . A small triangle appears next to the line numbers.
2 Click the triangle to collapse or expand the code.
To expand all the collapsed code in the document, you can use the keyboard shortcut Control+Alt+E (Win);
Command+Alt+E (Mac).