He has served as technitechni-cal editor for this release of the Dreamweaver Bible and the previous five versions of it, and provided technical editing and screenshot creation for other
Trang 1
Master Dreamweaver CS5
for Windows® and Macs
Build your own dynamic,
data-driven sites
Flash®, and more
Trang 3
Bible
Trang 5Bible
Joseph Lowery
Trang 610475 Crosspoint Boulevard
Indianapolis, IN 46256
www.wiley.com
Copyright © 2010 by Wiley Publishing, Inc., Indianapolis, Indiana
Published simultaneously in Canada
ISBN: 978-0-470-58586-3
Manufactured in the United States of America
10 9 8 7 6 5 4 3 2 1
No part of this publication may be reproduced, stored in a retrieval system or transmitted in any form or by any
means, electronic, mechanical, photocopying, recording, scanning or otherwise, except as permitted under Sections
107 or 108 of the 1976 United States Copyright Act, without either the prior written permission of the Publisher, or
authorization through payment of the appropriate per-copy fee to the Copyright Clearance Center, 222 Rosewood
Drive, Danvers, MA 01923, (978) 750-8400, fax (978) 646-8600 Requests to the Publisher for permission should be
addressed to the Permissions Department, John Wiley & Sons, Inc., 111 River Street, Hoboken, NJ 07030, (201)
748-6011, fax (201) 748-6008, or online at http://www.wiley.com/go/permissions
Limit of Liability/Disclaimer of Warranty: The publisher and the author make no representations or warranties with
respect to the accuracy or completeness of the contents of this work and specifically disclaim all warranties, including
without limitation warranties of fitness for a particular purpose No warranty may be created or extended by sales or
promotional materials The advice and strategies contained herein may not be suitable for every situation This work is
sold with the understanding that the publisher is not engaged in rendering legal, accounting, or other professional
ser-vices If professional assistance is required, the services of a competent professional person should be sought Neither
the publisher nor the author shall be liable for damages arising herefrom The fact that an organization or Web site is
referred to in this work as a citation and/or a potential source of further information does not mean that the author or
the publisher endorses the information the organization or Web site may provide or recommendations it may make
Further, readers should be aware that Internet Web sites listed in this work may have changed or disappeared between
when this work was written and when it is read.
For general information on our other products and services please contact our Customer Care Department within the
United States at (877) 762-2974, outside the United States at (317) 572-3993 or fax (317) 572-4002.
Wiley also publishes its books in a variety of electronic formats Some content that appears in print may not be
avail-able in electronic books.
Library of Congress Control Number: 2010924596
Trademarks: Wiley and the Wiley logo are trademarks or registered trademarks of John Wiley & Sons, Inc and/or
its affiliates, in the United States and other countries, and may not be used without written permission Adobe and
Dreamweaver are registered trademarks of Adobe Systems, Inc All other trademarks are the property of their
respec-tive owners Wiley Publishing, Inc is not associated with any product or vendor mentioned in this book.
Trang 9Joseph Lowery has been writing about computers and new technology since 1981 He is
the author of the previous editions of Dreamweaver Bible as well as the recent Adobe CS4 Web
Workflows, Adobe CS3 Web Workflows, and CSS Hacks and Filters (all published by Wiley) He
is also the author of Joseph Lowery’s Beyond Dreamweaver, Dreamweaver MX 2004 Killer Tips
(with Angela Buraglia), and Dreamweaver MX 2004 Web Application Recipes and Dreamweaver 8
Recipes (with Eric Ott), all published by New Riders He has also written books on HTML and on
using the Internet for business His books are international bestsellers, having sold more than
400,000 copies worldwide in eleven different languages Joe is also a consultant and trainer and
has presented at Seybold in both Boston and San Francisco, Adobe conferences in the U.S and
Europe, and at ThunderLizard’s Web Design World He is currently a partner in Mark of the Joe
Communications, an eLearning consultancy
About the Technical Editor
Derren Whiteman has been working on computer books as an author, ghost writer, and
techni-cal editor since 1999 He has served as technitechni-cal editor for this release of the Dreamweaver Bible
and the previous five versions of it, and provided technical editing and screenshot creation for
other books, including Dreamweaver MX Killer Tips and Dreamweaver MX 2004 Killer Tips
On the Fireworks side, Derren is the coauthor of the Fireworks MX Bible and technical editor of
Adobe’s Fireworks CS4 Classroom in a Book and the Fireworks 3 and 4 Bibles In all, he has made
substantive contributions to 17 books on Dreamweaver and Fireworks Derren practices what he
preaches by using Dreamweaver and Fireworks in the Web design field and can often be found in
discussions about why you don’t “need” to use Photoshop to create great Web sites
When not working in Web-related fields, Derren enjoys digital photography, videography, and
DVD creation, usually entailing the use of iMovie, iDVD, Final Cut Express, or DVD Studio Pro
He is an avid Mac user and Apple proponent who makes his home in Toronto, Canada To find
About the Instructional Designer
One of the innovations in Dreamweaver CS5 Bible is the inclusion of Captivate simulations on the
Web site, one for each of the Dreamweaver Techniques in the book All of these interactive
mov-ies were created by Mark Fletcher
Mark Fletcher has been in the I.T industry for 20 years He is a seasoned instructional designer
and has created eLearning content for blue chip clients including Adobe Systems, Inc and
WebAssist.com Mark is a partner in the Rapid eLearning development company Mark of the Joe
Communications and is a regular contributor to Adobe’s Developer Center Mark was also the
technical editor for CSS Hacks and Filters by Joseph Lowery (Wiley Publishing, Inc.) Mark lives
on the Northwest coast of the United Kingdom with his wife Vanessa and their two children, Joel
Trang 10Acquisitions Editor
Scott Meyers
Senior Project Editor
Adaobi Obi Tulton
Mary Beth Wakefield
Associate Director of Marketing
Trang 11Part I: Laying the Groundwork in Dreamweaver 1
Chapter 1: Introducing Dreamweaver CS5 3
Chapter 2: Touring Dreamweaver 39
Chapter 3: Setting Your Preferences 99
Chapter 4: Setting Up Sites and Servers 143
Part II: Designing and Crafting Basic Pages 179
Chapter 5: Accessing the Code Directly 181
Chapter 6: Building Style Sheet Web Pages 253
Chapter 7: Working with Text 303
Chapter 8: Inserting Images 359
Chapter 9: Establishing Web Links 395
Part III: Adding Advanced Design Features .415
Chapter 10: Working with Divs and AP Elements 417
Chapter 11: Using Behaviors 465
Chapter 12: Setting Up Tables 507
Chapter 13: Interactive Forms 543
Chapter 14: Creating Lists 583
Chapter 15: Using Frames and Framesets 613
Chapter 16: Powering Ajax Pages with Spry 647
Chapter 17: Working with JavaScript Frameworks 703
Part IV: Incorporating Dynamic Data 719
Chapter 18: Establishing Connections and Recordsets 721
Chapter 19: Making Data Dynamic 755
Chapter 20: Managing Data 777
Chapter 21: Working with Dynamic Live View 793
Chapter 22: Crafting Multi-Page Applications 811
Chapter 23: Using Web Content Management Systems 851
Trang 12Part V: Including Multimedia Elements 871
Chapter 24: Adobe Photoshop, Fireworks, and Bridge Integration 873
Chapter 25: Inserting Flash Elements 907
Chapter 26: Adding Video to Your Web Page 917
Chapter 27: Using Audio on Your Web Page 947
Part VI: Enhancing Productivity and Web Site Management 961
Chapter 28: Using Dreamweaver Templates 963
Chapter 29: Using Library Items and Server-side Includes 1023
Chapter 30: Maximizing Cross-Browser Compatibility 1043
Chapter 31: Building Web Sites with a Team 1061
Chapter 32: Integrating with XML and XSLT 1115
Part VII: Extending Dreamweaver .1141
Chapter 33: Customizing Dreamweaver 1143
Chapter 34: Handling Server Behaviors 1193
Chapter 35: Creating Adobe AIR Applications 1227
Appendix A: What’s New in Dreamweaver CS5 1243
Appendix B: What’s on the Web Site? 1251
Index 1255
Trang 13Part I: Laying the Groundwork in Dreamweaver 1
Chapter 1: Introducing Dreamweaver CS5 .3
The Dynamic World of Dreamweaver 4
Connecting to the world’s data 4
True page representation 5
Integrated visual and text editors 6
World-class code editing 7
Web site maintenance tools 9
Team-oriented site building 10
The Dreamweaver Interface 10
Easy text entry 10
Drag-and-drop data fields 11
One-stop object modification 12
Accessing and managing resources 12
Complete custom environment 13
Managing keyboard shortcuts 14
Simple selection process 14
Enhanced layout options 15
Plugin media preview 15
Extended find and replace 15
Up-to-Date Code Standards 16
Cutting-edge CSS support 16
Addressing accessibility 17
Straightforward text and graphics support 17
Enhanced table capabilities 18
Easy form entry 19
Click-and-drag frame setup 19
Multimedia enhancements 20
Next-Generation Features 21
Content management system support 21
Ajax spoken here 21
Dynamic style updates 22
Photoshop, Flash, and Fireworks integration 23
Trang 14Server-side behaviors 23
XML and XSLT integration 24
CSS layout control 25
JavaScript behaviors 26
Program Extensibility 28
Objects and behaviors 28
Server Behavior Builder 28
Commands and floating panels 29
Adjustable Insert panels 30
Custom tags, translators, and Property inspectors 30
Automation Enhancements 30
Rapid application development with Data objects 30
Importing Office documents 32
Reference panel 32
History panel 32
Site Management Tools 33
Object libraries 33
Supercharged templates 34
Browser targeting 35
Converting Web pages 36
Verifying links 36
FTP publishing 36
File Check In/Check Out 37
Summary 38
Chapter 2: Touring Dreamweaver 39
Choosing a Workspace Layout 39
Viewing the Document Window 44
Switching views in the Document window 45
Working with the status bar 49
Accessing the Toolbars 55
The Application bar 56
The Related Files bar 57
The Document toolbar 57
The Standard toolbar 61
The Style Rendering toolbar 62
The Coding toolbar 63
The Browser Navigation toolbar 66
Selecting from the Insert Panel 67
Common objects 69
Layout objects 70
Forms objects 71
Data objects 72
Spry objects 73
InContext Editing objects 76
Trang 15Text objects 77
Favorites 78
ASP objects 79
CFML objects 79
PHP objects 80
XSLT objects 80
Getting the Most Out of the Property Inspector 80
Manipulating the Property inspector 81
Property inspector elements 82
Customizing Your Workspace with Dockable Panels 84
Hiding and showing panels 88
Customizing panel groups 89
Accessing the Menus 90
Connecting to Adobe Services 92
Getting online with Business Catalyst 92
Fine-tuning with BrowserLab 93
Screen sharing in Dreamweaver .94
Additional Adobe services 96
Summary 96
Chapter 3: Setting Your Preferences 99
Customizing Your Environment 99
General preferences 100
Preferences for invisible elements 106
Highlighting preferences 108
Status Bar preferences 109
File Types/Editors preferences 111
Copy/Paste preferences 114
New Document preferences 116
Adjusting Advanced Features 118
Accessibility preferences 118
AP Elements preferences 119
CSS Styles preferences 122
Making Online Connections 124
Site preferences 124
Preview In Browser preferences 127
Customizing Your Code 129
Fonts preferences 129
Code Hints preferences 131
Code Rewriting preferences 132
Code Coloring preferences 135
Code Format preferences 136
Validator preferences 140
Summary 142
Trang 16Chapter 4: Setting Up Sites and Servers 143
Planning Your Site 144
Deciding what you want to say 144
Targeting your audience 145
Determining your resources 145
Mapping Dynamic Pages for Web Applications 146
Defining a Site 146
Working with Site Setup 147
Establishing local connections 147
Specifying a remote server 151
Defining a testing server 156
Cloaking Site Folders 157
Managing Site Info 159
Creating and Saving New Pages 160
Starting Dreamweaver 161
Opening existing files 161
Opening a new file 162
Saving your file 163
Closing the file 164
Quitting the program 164
Creating New Documents 164
Using the New Document dialog box 165
Creating a new default document 167
Previewing Your Web Pages 168
Previewing in your browsers 168
Displaying pages with BrowserLab 170
Putting Your Pages Online 173
Transferring with FTP 173
Using the FTP Log panel 175
Summary 176
Part II: Designing and Crafting Basic Pages 179 Chapter 5: Accessing the Code Directly 181
The Structure of a Web Page 182
Expanding into XHTML 183
doctype and doctype Switching 184
Defining <head> Elements 186
Establishing Page Properties 186
Understanding <meta> and other <head> tags 193
Adding to the <body> 200
Logical styles 200
Physical styles 201
Working with Code View and the Code Inspector 202
Printing code 205
Trang 17Integrating Live View, Related Files, and Code Navigator Features 205
Enhanced workflow with Live View 206
Accessing Related Files 211
Navigating with the Code Navigator 212
Using the Coding Toolbar 214
Code collapse 214
Code selection and highlight 217
Commenting code 217
Manipulating CSS 217
Other Coding toolbar functions 219
Enhancing Code Authoring Productivity 219
Code Hints and Tag Completion 220
Modifying blocks of code 222
Inserting code with the Tag Chooser 224
Adding Code Through the Snippets Panel 226
Using the Reference Panel 229
Modifying Code with the Tag Inspector 231
Rapid Tag Modification with the Quick Tag Editor 232
Insert HTML mode 234
Wrap Tag mode 235
Edit Tag mode 237
Adding Java Applets 239
Managing JavaScript and VBScript 241
Inserting JavaScript and VBScript 242
Editing JavaScript and VBScript 243
Extracting JavaScript 245
Validating Your XML Pages 246
Inserting Symbols and Special Characters 248
Named characters 249
Decimal characters and UTF-8 encoding 249
Using the Character objects 250
Summary 252
Chapter 6: Building Style Sheet Web Pages 253
Understanding Cascading Style Sheets 255
Grouping properties 255
Inheritance of properties 256
Cascading characteristics 256
Defining new class and ID selectors for extended design control 257
Specificity 258
How styles are applied 259
Working with the CSS Styles Panel 261
All mode 261
Current mode 263
Creating and Applying Styles 265
Generating new styles 265
Trang 18Applying styles through the Property inspector 270
Attaching an external style sheet 271
Applying, changing, and removing a style 273
Editing and managing style sheets 277
Debugging your applied CSS 284
Styles and Their Attributes 287
Type options 288
Background options 289
Block options 291
Box options 293
Border options 294
List options 295
Positioning options 296
Extensions options 297
Design-Time Style Sheets 301
Summary 302
Chapter 7: Working with Text 303
Starting with Headings 304
Working with Paragraphs 307
Inserting text 308
Cutting, copying, and pasting 308
Using drag-and-drop 309
Inserting text from other text applications 310
Copying and pasting code 311
Undo, redo, and the History panel 311
Checking Your Spelling 313
Using Find and Replace 314
Finding on the visual page 315
Searching the code 319
Concentrating your search with regular expressions 325
Controlling Whitespace 329
Indenting text 329
Working with preformatted text 330
The <br> tag 331
Working with Microsoft Office Documents 333
Copying and pasting Office content 333
Importing Office documents 334
Dragging and dropping Word and Excel files 335
Importing Word HTML 336
Styling Your Text 339
Depicting various styles 339
Using the <address> tag 342
Adding abbreviations and acronyms 342
Modifying Text Format 343
Adjusting font size 343
Adding font color 345
Trang 19Assigning a specific font 349
Aligning text 352
Indenting entire paragraphs 353
Incorporating Dates 354
Commenting Your Code 356
Summary 358
Chapter 8: Inserting Images 359
Using Images Inline 360
Inserting images 360
Dragging images from the Assets panel 365
Optimizing and altering images 368
Modifying image attributes 376
Working with alignment options 381
Adding Background Images 385
Dividing the Web Page with Horizontal Rules 387
Including Banner Ads 389
Inserting Rollover Images 392
Summary 394
Chapter 9: Establishing Web Links 395
Understanding URLs 395
Surfing the Web with Hypertext 398
Eliminating underlines from links 400
Inserting URLs from the Assets panel 401
Pointing to a file 403
Addressing types 404
Checking links 405
Adding an E-mail Link 407
Navigating with Anchors 408
Moving within the same document 410
Using named anchors in a different page 410
Creating null links 411
Targeting Your Links 413
Summary 414
Part III: Adding Advanced Design Features 415 Chapter 10: Working with Divs and AP Elements 417
Divs and AP Elements 101 419
Placing <div> Tags 421
Defining a CSS rule for a <div> tag 421
Inserting the <div> tag 422
Visualizing <div> tags 425
Creating AP Elements with Dreamweaver 431
Inserting an AP element object 432
Trang 20Using the Insert ➪ Layout Objects ➪ AP Div option 433
Setting default characteristics of an AP element 433
Choosing relative instead of absolute positioning 435
Modifying an AP Element 436
Selecting an AP element 436
Resizing an AP element 437
Moving an AP element 438
Using the CSS-P Property inspector 438
The AP Elements panel 445
Aligning AP elements 447
Adding elements to an AP element 455
Forms and AP elements 455
Creating Your Page Design with AP Elements 456
Using the Tracing Image 456
Preventing overlaps 458
Activating AP Elements with Behaviors 458
Drag AP Element 458
Set Text of Container 461
Show-Hide Elements 462
Summary 463
Chapter 11: Using Behaviors 465
Understanding Behaviors, Events, and Actions 465
Attaching a Behavior 466
Using the Behaviors panel 467
Adding a behavior 468
Managing events 470
Standard actions 472
Spry effects in Dreamweaver 494
Installing, Managing, and Modifying Behaviors 501
Altering the parameters of a behavior 502
Sequencing behaviors 503
Deleting behaviors 503
Summary 505
Chapter 12: Setting Up Tables 507
HTML Table Fundamentals 508
Rows 509
Cells 510
Column and row headings 511
Inserting Tables in Dreamweaver 511
Modifying Tables 516
Selecting table elements 516
Editing a table’s contents 520
Working with table properties 524
Setting cell, column, and row properties 536
Trang 21Sorting Tables 538
Importing Tabular Data 540
Summary 542
Chapter 13: Interactive Forms 543
How HTML Forms Work 544
Inserting a Form in Dreamweaver 546
Using Text Fields 548
Inserting text fields 548
Creating password fields 550
Inserting multiline text areas 550
Providing Checkboxes and Radio Buttons 554
Checkboxes 554
Radio buttons 554
Creating Form Lists and Menus 559
Drop-down menus 559
Menu values 560
Scrolling lists 561
Navigating with a Jump Menu 565
Modifying a jump menu 567
Activating Go buttons 568
Activating Your Form with Buttons 569
Submit, Reset, and Command buttons 569
Graphical buttons 570
Using Hidden and File Fields 572
The hidden input type 572
The file input type 573
Improving Accessibility 573
Styling Forms with CSS 575
Highlighting the form 575
Altering input fields 576
Distinguishing lists and menus 577
Changing labels and legends 578
Highlighting focus 579
Summary 580
Chapter 14: Creating Lists 583
Creating Unordered (Bulleted) Lists 584
Editing unordered lists 586
List tags 586
Using other bullet symbols 588
Styling lists with CSS 590
Mastering Ordered (Numbered) Lists 591
Editing ordered lists 592
Using other numbering styles 594
Trang 22Creating Navigation Buttons from Lists 595
Step 1: Preparing background graphics 596Step 2: Creating the list and containing <div> 597Step 3: Building the CSS styles 600Step 4: Applying the CSS 605Making Definition Lists 606
Using Nested Lists 608
Accessing Special List Types 610
Menu lists 611Directory lists 611Summary 612
Chapter 15: Using Frames and Framesets 613
Frames and Framesets: The Basics 614
Columns and rows 615Sizing frames 615Creating a Frameset and Frames 616
Creating a new frameset file 616Hand-coding framesets 618Creating a frameset visually 619Creating framesets quickly with frame objects 620Adding More Frames 623
Using the menus 623Using the mouse 624Selecting, Saving, and Closing Framesets 625
Selecting framesets and frames 625Saving framesets and frames 626Closing framesets 626Working with the Frameset Property Inspector 628
Resizing frames in a frameset 628Manipulating frameset borders 630Modifying a Frame 631
Page properties 631Working with the Frame Property inspector 632Modifying content 636Deleting frames 636Targeting Frame Content 637
Targeting sections of your frameset 637Targeting specific frames in your frameset 638Updating two or more frames at once 638Handling Frameless Browsers 641
Investigating Iframes 642
Summary 646
Trang 23Chapter 16: Powering Ajax Pages with Spry 647
Understanding Ajax and Spry 648What is Ajax? 648What is Spry? 649Integrating XML or HTML Data with Spry 651Merging HTML data into Web pages 652Connecting to XML data 657Defining Spry regions 662Binding data to the page 664Repeating Spry regions 666Enhancing Your Site with Spry Widgets 672Validating form fields 673Extending layout options 689Spry Effects 700Summary 701
Chapter 17: Working with JavaScript Frameworks 703
Using JavaScript Frameworks 704Integrating Framework Functions 706Implementing a Web Widget 710Installing and using legacy Web widgets 711Working with the Widget Browser 714Summary 718
Chapter 18: Establishing Connections and Recordsets 721
Data Source Basics 722Understanding How Active Content Pages Work 725Opening a Connection to a Data Source 727Using Data Source Names 728Specifying connection strings 736PHP 740Managing Connections 741Extracting Recordsets 743Building simple recordsets 743Writing advanced SQL statements 746Working with recordsets 750Summary 753
Chapter 19: Making Data Dynamic 755
Working with Dynamic Text 755Inserting dynamic text 756Viewing dynamic data 758
Trang 24Formatting Dynamic Data 760
Data formatting 760Editing and creating new data formats 766Making Images Dynamic 768
Integrating Flash and Other Dynamic Media 773
Summary 775
Chapter 20: Managing Data 777
Displaying Data Conditionally 777
Repeating data 778Showing and hiding page elements 783Handling Record Navigation 785
Building record navigation links 785Using Data objects for record navigation 787Tracking record status 788Summary 791
Chapter 21: Working with Dynamic Live View 793
Engaging Live View 794
How Live View works 794Setting up for Live View 796Entering and exiting Live View 798Making changes in Live View 799HTTP Request Settings 800
Getting the query string 800Posting responses with HTTP Request Settings 802Previewing an Application in the Browser 805
Using the Server Debug Panel with ColdFusion 807
Summary 809
Chapter 22: Crafting Multi-Page Applications 811
Using the URL to Pass Parameters 812
Sending parameters 812Receiving parameters 814Automating Master-Detail Page production 818Getting Values from a Form 822
Passing single values from a form 823Passing multiple values from a form 824Passing form and URL values to a related page 825Establishing Dynamic Form Elements 828
Text fields 828Checkboxes 829Radio buttons 830List/menus 831Managing Data Sources Online 832
Inserting data 833Updating data 836Deleting data 839
Trang 25Inserting Variables 840Application and session variables 840Request and other variables 840Connecting to the Customer 843Logging in existing customers 843Restricting access 845Helping users log out 847Adding new customers 848Summary 849
Chapter 23: Using Web Content Management Systems 851
Understanding Web Content Management Systems 852Working with WordPress 853Installing WordPress 855Discovering dynamically related files 861Customizing your WordPress site 863Adjusting graphics in a WordPress site 866Summary 870
Chapter 24: Adobe Photoshop, Fireworks, and Bridge Integration 873
Bringing in Photoshop Images 875Inserting Photoshop files 875Copying and pasting from Photoshop 877Updating a Photoshop Smart Object 878Integrating Fireworks 882Optimizing an image in Fireworks 883Editing an image in Fireworks 888Replacing an image placeholder using Fireworks 890Inserting Rollovers 893Using Dreamweaver’s behaviors 894Using Fireworks’ code 896Modifying sliced images 899Building Dreamweaver/Fireworks Extensions 901Working with Bridge 903Summary 904
Chapter 25: Inserting Flash Elements 907
Including SWF Files in Dreamweaver Projects 908Designating SWF Attributes 910Setting Scale in Flash movies 912Additional parameters for Flash 913Configuring MIME Types 913Editing SWF Files from Within Dreamweaver 913Adding Shockwave Files 915Summary 916
Trang 26Chapter 26: Adding Video to Your Web Page 917
The Flash Video Revolution 918
Encoding video 919Progressive download versus streaming 920Inserting Flash video 921Publishing Flash video files 924Modifying Flash video parameters 925Mainstream Streaming Media 927
RealMedia 927QuickTime 928Windows Media 929Working with Video Clips 931
Linking to video 932Embedding video 933Playing Videos in Dreamweaver 934
Inserting QuickTime Movies 934
QuickTime versions 939Streaming with RealMedia 942
Creating RealMedia metafiles 942Inserting RealMedia in your Web page 943Summary 945
Chapter 27: Using Audio on Your Web Page 947
Linking to Audio Files 948
Embedding Sounds and Music 950
Playing Background Music 951
Targeting Specific Plugins 953
Windows Media Player audio 953Using embed with ActiveX 956Integrating Podcasts 956
Podcast XML feeds 957Linking to podcasts and feeds 958Summary 959
Part VI: Enhancing Productivity and Web Site Management 961
Chapter 28: Using Dreamweaver Templates 963
Understanding Templates 964
Creating Your Own Templates 966
Using Editable Regions 967
Marking existing content as editable 967Inserting a new editable region 968Creating links in templates 969Locking an editable region 971
Trang 27Adding Content to Template Documents 971Making Attributes Editable 975Setting Editable Attributes 978Enabling Repeating Regions 979Modifying a repeating region 981Constructing a repeating table 982Establishing Optional Regions 985Combining editable and optional regions 988Setting optional region properties 989Evaluating template expressions 989Template expression examples 994Nesting Templates 1001Working with Templates in the Assets Panel 1003Creating a blank template 1005Opening and deleting templates 1005Applying templates 1006Mapping inconsistent template regions 1006Updating Templates 1008Removing Template Markup 1009Deleting template markup individually 1009Removing template markup from an entire page 1009Exporting a site without template markup 1010Changing the Default Document 1011Editing Content in the Browser 1012Setting up InContext Editing templates 1013Registering an InContext Editing site 1018Making edits online 1020Summary 1022
Chapter 29: Using Library Items and Server-side Includes 1023
Dreamweaver Library Items 1024Using the Library Assets Panel 1025Adding a Library item 1026Moving Library items to a new site 1027Inserting a Library item in your Web page 1028Deleting an item from the Library 1030Renaming a Library item 1031Editing a Library Item 1032Updating Your Web Sites with Libraries 1034Applying Server-side Includes 1037Adding server-side includes 1039Editing server-side includes 1040Summary 1041
Trang 28Chapter 30: Maximizing Cross-Browser Compatibility 1043
Converting Pages in Dreamweaver 1044
Validating Your Code 1045
Setting Validator preferences 1047Checking Your Page for Compatibility 1048
Checking your pages 1052Using the results of the Browser Compatibility Check 1056Summary 1058
Chapter 31: Building Web Sites with a Team 1061
Following Check In/Check Out Procedures 1062
Check In/Check Out overview 1063Enabling Check In/Check Out 1064Checking files in and out 1066Keeping Track with Design Notes 1068
Setting up for Design Notes 1069Setting the status with Design Notes 1070Creating custom Design Notes 1071Viewing Design Notes 1072Browsing File View Columns 1072
Generating Reports 1075
Outputting HTML reports 1078Using Workflow reports 1078Administering Adobe Contribute Sites 1080
Setting up Contribute compatibility 1082Entering sitewide administrator settings 1083Establishing Contribute roles 1085Connecting users 1097Rolling back a Contribute page in Dreamweaver 1100Communicating with WebDAV 1102
Version Control with Subversion 1103
Connecting to a Subversion server 1104Managing files in the repository 1106Summary 1114
Chapter 32: Integrating with XML and XSLT 1115
Trang 29Part VII: Extending Dreamweaver 1141
Chapter 33: Customizing Dreamweaver 1143
Adding New Commands 1144Understanding Dreamweaver commands 1145Recording and replaying commands 1148Scripting commands 1151Useful command routines 1153Managing Menus and Keyboard Shortcuts 1158Handling History panel commands 1159Using the Keyboard Shortcut editor 1160Adjusting the menus.xml file 1162Building menu commands 1167Working with Custom Tags 1168Customizing Property Inspectors 1171Coding a Property inspector 1171Designing a Property inspector 1175Making Custom Floating Panels 1176Developing Translators 1179Translator functions 1180Locking code 1182Extending C-Level Libraries 1183Calling C-level extensions 1184Building C-level extensions 1185Customizing Your Tag Libraries 1186Editing tag libraries, tags, and attributes 1186Creating and deleting tag libraries, tags, and attributes 1188Importing a DTD or schema to create a new tag library 1190Summary 1190
Chapter 34: Handling Server Behaviors 1193
Understanding Server Behaviors 1194Applying and Managing Server Behaviors 1195Inserting and removing server behaviors 1195Editing the parameters 1196Standard Server Behaviors 1197Recordset (Query) 1197Repeat Region 1198Recordset Paging 1199Move To Specific Record 1200Show Region 1201
Go To Detail Page 1202
Go To Related Page 1204Insert Record 1205
Trang 30Update Record 1206Delete Record 1207User authentication 1208Dynamic elements 1213Stored procedure/command/callable 1218Installing Additional Server Behaviors 1220
Creating Custom Server Behaviors 1221
Summary 1225
Chapter 35: Creating Adobe AIR Applications 1227
About Adobe AIR 1228
Installing AIR into Dreamweaver 1230
Designing for AIR 1231
Packaging Your AIR Application 1235
Summary 1241
Appendix A: What’s New in Dreamweaver CS5 1243
Dynamic Scope Expanded 1243
Totally Revamped Site Setup 1245
CSS Integration Enhanced 1247
Online Services Take Off 1248
Older Features Removed 1250
Appendix B: What’s on the Web Site? 1251
Visiting the Book’s Web Site 1251
Files and Programs on the Web Site 1252
Dreamweaver extensions 1252Dreamweaver Techniques simulations and files 1252
Adobe Dreamweaver CS5 Bible code examples 1253
Web resource directory 1253Troubleshooting 1253
Index 1255
Trang 31Wyou’re a deadline-driven professional or a vision-filled amateur, Dreamweaver
pro-vides an intuitive way to make your Web visions a reality and excels at producing multifaceted
Web pages that bring content locked in a data store to the surface
Dreamweaver CS5 stands at the center of a complex series of overlapping worlds In one realm,
designers of static Web pages are looking to expand their knowledge base into data-driven sites
Over there, you’ll find application developers — some savvy in Active Server Pages, some in
ColdFusion, and others in PHP — anxious to develop for the Internet Another group specializes
in sites that utilize content management systems such as WordPress, Joomla, and Drupal The
spectrum of experience in both camps runs the gamut from eager novice to experienced
profes-sional, all of whom benefit from the advanced style capabilities of Cascading Style Sheets (CSS)
There’s yet another group of prospective Web craftsmen and artists who want to do it all and are
looking for a place to start Dreamweaver CS5 is the one program robust enough for them all, and
Dreamweaver CS5 Bible is your guidebook to all its features and capabilities.
To use this book, you need only two items: the Dreamweaver software and a desire to make
cutting-edge Web pages (If you don’t have Dreamweaver, you can download a trial copy from
www.adobe.com.) From quick design prototyping to ongoing Web site management,
Dream-weaver automates and simplifies much of a Webmaster’s workload DreamDream-weaver is not only
the first Web-authoring tool to bring the ease of visual editing to an HTML code–oriented
world, it also brings a point-and-click interface to complex coding whether server-side or
client-side Dreamweaver CS5 Bible is designed to help you master every nuance of the program
Are you styling your pages and creating your layouts with CSS? Are you building multipage Web
applications? Are you creating a straightforward layout with the visual editor? Do you need to
extend Dreamweaver’s capabilities by building your own custom objects? With Dreamweaver
and this book, you can weave your dreams into reality for the entire world to experience
Who Should Read This Book
Dreamweaver attracts a wide range of Web developers Because it’s the first Web authoring tool
that doesn’t rewrite original code, veteran designers are drawn to using Dreamweaver as their
first visual editor Because it also automates complicated effects, beginning Web designers are
interested in Dreamweaver’s power and performance Dreamweaver CS5 Bible addresses the full
spectrum of Web professionals, providing basic information on HTML if you’re just starting, as
well as advanced tips and tricks for seasoned pros Moreover, this book is a complete reference for
everyone working with Dreamweaver on a daily basis
Trang 32How This Book Is Organized
Dreamweaver CS5 Bible can take you from raw beginner to full-fledged professional if read cover
to cover However, you’re more likely to read each section as needed, taking in the necessary
information and coming back later To facilitate this approach, Dreamweaver CS5 Bible is divided
into seven major task-oriented parts After you’re familiar with Dreamweaver, feel free to skip
around the book, using it as a reference guide as you increase your own knowledge base
The early chapters present the basics, and all chapters contain clearly written steps for the
tasks you need to perform In most chapters, you encounter two special sections: Dreamweaver
Quickstarts and Dreamweaver Techniques A Dreamweaver Quickstart is just as it sounds: a few
quick steps that show you how to achieve a targeted goal, such as creating a link Dreamweaver
Techniques are step-by-step instructions for accomplishing specific Web designer tasks; taken
together, the Dreamweaver Techniques constitute an entire how-to course These step-by-step
instructions are self-contained in each chapter, so you’re free to explore them in any order you
choose You’ll find all the practice files for working on the Techniques on the Web site, both as
starting points and as completed files Naturally, you can also use the Dreamweaver Techniques
as stepping-stones for your own explorations into Web page creation
You’ll find yet another cool addition to the Dreamweaver Bible on the Web site: interactive
simu-lations for each Dreamweaver Technique Created by master trainer Mark Fletcher with Adobe
Captivate, these simulations give you the opportunity to practice all the steps in each Technique
As my dad used to say, “Get it in your hand and you’ll get it in your head.”
The Web site also offers a vast number of additional Dreamweaver server behaviors, objects,
com-mands, and other extensions, in addition to relevant code from the book
Part I: Laying the Groundwork in Dreamweaver CS5
Part I begins with an overview of Dreamweaver’s philosophy and design To get the most out of
the program, you need to understand the key advantages it offers over other authoring programs
and how Dreamweaver addresses the deficiencies of those programs Part I takes you all the way
to setting up your first site
Part II: Designing and Crafting Basic Pages
Although Dreamweaver is partly a visual design tool, its roots derive from the language of the
Web: HTML Part II gives you a solid foundation in the basics of HTML, even if you’ve never seen
code It also shows you how to get the most out of Dreamweaver’s code environment with any
language Chapter 6 describes what you need to know about the overall structure of a Web page,
including the all-important <meta> tags
Reflecting the current emphasis in Web design on Cascading Style Sheets, Chapter 5 lays the
foundation to CSS In this chapter, you learn the basics of CSS, as well as how to define and apply
styles in Dreamweaver Following the introduction to CSS, you learn the three fundamentals of
static Web pages: text, images, and links In Chapters 7, 8, and 9, you explore how to completely
incorporate these elements
Trang 33Part III: Adding Advanced Design Features
After you master the basics, you’re ready to learn about some of Dreamweaver’s true power tools
Dreamweaver as AP elements Chapter 10 examines this brave new world of pixel-perfect
posi-tioning, AP elements that fly in and then disappear as if by magic, and Web sites that can change
their look and feel at the click of a mouse Chapter 11 offers an in-depth look at the capabilities
of Dreamweaver behaviors These bring a great deal of interactivity to AP elements specifically
and to your Web page in general Each standard behavior is covered in detail with step-by-step
instructions
Chapter 12 explores the various uses of tables — from a clear presentation of data to organizing
entire Web pages Here you learn how to use Dreamweaver’s visual table editing capabilities to
resize and reshape your HTML tables quickly Forms are an essential element in dynamic Web
page design, and you learn all about them in Chapter 13 Chapter 14 presents another
fundamen-tal HTML option: lists You study the list in all its forms: numbered lists, bulleted lists, definition
lists, nested lists, and more
Chapter 15 investigates the somewhat complex world of frames You see how Dreamweaver has
greatly simplified the task of building and managing these multifile creations, particularly with
the Frame objects You also learn how to handle more advanced design tasks such as updating
multiple frames with just one click
Chapter 16 takes the Web to a whole new level: Web 2.0 to be exact With the introduction of the
Spry framework, Adobe has made the sophisticated inner-workings of Ajax accessible to every Web
developer This chapter explains what Ajax is and how Spry fits into the picture before diving into
the wide range of Spry tools available in Dreamweaver CS5, including Spry Data, Spry Widgets,
and Spry Effects Chapter 17 broadens Dreamweaver’s scope to incorporate other JavaScript
frameworks such as jQuery, YUI, or MooTools
Part IV: Incorporating Dynamic Data
Chapter 18 begins an in-depth investigation of Dreamweaver’s power to create dynamic Web
pages by describing how to set up your basic connections and recordsets Chapter 19 explains
how to insert text from a data source onto your Web page and how to format it after it’s
incor-porated You also see how to relate other Web page elements — such as images, Flash movies,
and other media files — to a data source Chapter 20 continues the exploration by delving into
Dreamweaver’s powerful Repeat Region server behavior as well as discussing techniques for
hid-ing and showhid-ing your data at will
One of Dreamweaver’s most useful features, the Live View, is examined extensively in Chapter 21,
through the lens of application development Chapter 22 enters the world of multipage
applica-tions and explains how variables and other data can be passed from one page to another The
final chapter in this part, Chapter 23, dives into the brave new world of content management
systems with step-by-step instructions for setting up and integrating WordPress into your
Dreamweaver workflow
Trang 34Part V: Including Multimedia Elements
In recent years, the Web has moved from a relatively static display of text and simple images to
a full-blown multimedia circus with streaming video, background music, and interactive
anima-tions Part V contains the power tools for incorporating various media files into your Web site
Graphics remain the key medium on the Web today, and Adobe’s graphics programs are the
world leaders Chapter 24 delves into methods for incorporating both Adobe Photoshop Smart
objects and Adobe Fireworks graphics as well as graphics management through Adobe Bridge
Special focus is given to the Dreamweaver-to-Photoshop and Dreamweaver-to-Fireworks
commu-nication links and how your Web production efforts can benefit from it
In addition to Dreamweaver, Adobe is perhaps best known for one other contribution to Web
multimedia: Adobe Flash Chapter 25 explores the possibilities offered by incorporating Flash
and Shockwave movies into Dreamweaver-designed Web pages and includes everything you need
to know about configuring MIME types You also find step-by-step instructions for building
Shockwave inline controls and playing Shockwave movies in frame-based Web pages
Chapter 26 covers digital video in its many forms — downloadable AVI files, streaming RealVideo
displays, panoramic QuickTime movies, and the newest, hottest media: Flash video Chapter 27
focuses on digital audio, with coverage of standard WAV and MIDI sound files as well as the
newer streaming audio formats such as MP3
Part VI: Enhancing Productivity and Web Site
Management
Although Web page design gets all the glory, Web site management pays the bills In Part VI,
you see how Dreamweaver makes this essential part of any Webmaster’s day easier to handle
Chapter 28 starts off with a look at the use of Dreamweaver Templates and how they can speed
up production while ensuring a unified look and feel across your Web site, along with the
in-browser site modifications possible with the InContext Editing service Chapter 29 covers the
Library, which can significantly reduce any Webmaster’s workload by providing reusable — and
updatable — page elements Chapter 30 describes Dreamweaver’s built-in tools for
maintain-ing cross- and backward-browser compatibility, includmaintain-ing the essential Browser Compatibility
Check, which reviews your page for rendering issues in a number of modern browsers
Until now, individual Web developers have been stymied when attempting to integrate
Dream-weaver into a team development environment File locking was all too easily subverted, allowing
team members to inadvertently overwrite revisions Site reports were limited in scope and output
only to HTML, and, worst of all, version control was nonexistent Dreamweaver CS5 tackles all
these concerns while laying a foundation for future connectivity In Chapter 31, you see how you
can tie Dreamweaver into an existing Visual SourceSafe, WebDAV, or Subversion version control
system Other new features covered include custom file view columns and enhanced Design
Notes accessibility
I can’t think of any new technology on the Web that has gained widespread acceptance as quickly
as XML In a nutshell, XML (short for Extensible Markup Language) enables you to create your
Trang 35own custom tags that make the most sense for your business or profession Although XML
doesn’t enjoy full browser support as of this writing, it’s only a matter of time — and little time
at that Chapter 32 shows you how to apply this fast-approaching technology of tomorrow in
Dreamweaver today, with a special section on Dreamweaver CS5’s new XML/XSLT technology
Part VII: Extending Dreamweaver
Dreamweaver is a program with immense capabilities for expanding its own power Chapter 33
explores the brave new world of Dreamweaver extensibility, with complete coverage of using and
building commands as well as custom tags, translators, floaters, and C-level extensions With
its own set of objects and behaviors, Dreamweaver complements HTML’s extensibility Finally,
Chapter 34 examines server behaviors, describing every standard one in detail and then
explor-ing the use of the Server Behavior Builder, Dreamweaver’s tool for createxplor-ing custom server
behav-iors Finally, in Chapter 35, you can see how Dreamweaver is on the cutting edge of producing
Adobe AIR applications
Appendices
Want to know what’s hot and new in Dreamweaver CS5? Turn to Appendix A for a quick tour of
the latest and greatest — as well as fond farewell to features cut from the program Appendix B
dreamweaverCS5bible Throughout this book, whenever you encounter a reference to files or
programs on the Web site, please check this appendix for more information
Conventions and Features
There are many different organizational and typographical features throughout this book designed
to help you get the most of the information
Windows and Macintosh Conventions
Because Dreamweaver CS5 Bible is a cross-platform book, it gives instructions for both Windows
and Macintosh users when keystrokes for a particular task differ Throughout this book, the
Windows keystrokes are given first; the Mac’s are given second in parentheses, as follows:
To undo an action, press Ctrl+Z (Command+Z)
The first action instructs Windows users to press the Ctrl and Z keys in combination, and the
second action (in parentheses) instructs Macintosh users to press the Command and Z keys
together
Key Combinations
When you are instructed to press two or more keys simultaneously, each key in the combination
is separated by a plus sign For example:
Ctrl+Alt+T (Command+Option+T)
Trang 36The preceding tells you to press the three listed keys for your system at the same time You can also
hold down one or more keys and then press the final key Release all the keys at the same time
Mouse Instructions
When instructed to click an item, move the mouse pointer to the specified item and click the
mouse button once Windows users use the left mouse button unless otherwise instructed
Double-clicking means clicking the mouse button twice in rapid succession
When instructed to select or choose an item, you can click it once as previously described If you
are selecting text or multiple objects, click the mouse button once, press Shift, and then move the
mouse to a new location and click again The color of the selected item or items inverts to indicate
the selection To clear the selection, click once anywhere on the Web page
Menu Commands
When instructed to select a command from a menu, you see the menu and the command
sepa-rated by an arrow symbol For example, when instructed to execute the Open command from the
File menu, you see the notation File ➪ Open Some menus use submenus, in which case you see
an arrow for each submenu, as follows: Insert ➪ Form Object ➪ Text Field
Typographical Conventions
I use italic type for new terms and for emphasis and boldface type for text that you need to type
directly from the computer keyboard
This code font is also used within paragraphs to designate HTML tags, attributes, and values
by Dreamweaver, although browsers are not generally case-sensitive in terms of HTML
Dreamweaver Quickstarts
Located right at the start of many chapters, Dreamweaver Quickstarts give you the just the details
you need to accomplish common Web design tasks A Dreamweaver Quickstart is great for folks
who are familiar with a given Web element such as tables or lists and want to know how to use it
in Dreamweaver
Trang 37Dreamweaver Techniques
A Dreamweaver Technique section provides the steps you need to try out a specific Dreamweaver
task An interactive simulation of each technique is included in the download material on this
book’s Web site
Tips, Notes, and Cautions
Whenever the authors want to bring something important to your attention the information will
appear in a Tip, Note, or Caution
Caution
This information is important and is set off in a separate paragraph Cautions provide information about
things to watch out for, whether simply inconvenient or potentially hazardous to your data or systems n
Tip
Tips generally are used to provide information that can make your work easier — special shortcuts or methods
for doing something easier than the norm n
Dreamweaver CS5 Bible includes coverage of Dreamweaver CS5 Written to be platform-independent,
this book covers both Macintosh and Windows versions of Dreamweaver CS5
Trang 38These are the minimum requirements As with all graphics-based design tools, more capability is
definitely better for using Dreamweaver, especially in terms of memory and processor speed
Further Information
You can find more help for specific problems and questions by investigating several Web sites
Adobe’s own Dreamweaver Web site is the best place to start:
www.adobe.com/products/dreamweaver/
I heartily recommend that you visit and participate in the official Dreamweaver forums:
www.adobe.com/cfusion/webforums/forum/index.cfm?forumid=12
I can’t promise instantaneous turnaround, but I answer all my mail to the best of my ability
Trang 39Part I
Laying the Groundwork in Dreamweaver