Transcription

Dreamweaver CS 5.5Creating Web Pages with a TemplateUniversity Information Technology ServicesTraining, Outreach, Learning Technologies, and Video Production

Copyright 2012 KSU Department of Information Technology ServicesThis document may be downloaded, printed, or copied for educational use without further permissionof the Information Technology Services Department (ITS), provided the content is not modified and thisstatement is not removed. Any use not stated above requires the written consent of the ITSDepartment. The distribution of a copy of this document via the Internet or other electronic mediumwithout the written permission of the KSU - ITS Department is expressly prohibited.Published by Kennesaw State University – ITS 2012The publisher makes no warranties as to the accuracy of the material contained in this document andtherefore is not responsible for any damages or liabilities incurred from its use.

Dreamweaver CS 5.5Creating Web Pages with a TemplateTable of ContentsIntroduction .1Terms and Definitions .2File Naming Conventions .3Create a Local Folder .3Web Servers .4The Dreamweaver Environment .4Defining a Site.6Connecting to Server .12Designing Your Site .13Creating the Template .14Creating a New Web Page from a Template .24Adding Images to a Web Page or Template.27Adding Hyperlinks to a Web Page .29Adding Anchor Links to a Web Page .32Publishing Your Website .33Viewing Your Website.35Reconnecting From Another Location .35Backing Up your Site Definition.36

IntroductionThe purpose of this booklet is to help students, faculty, and staff understand the process involved withcreating and publishing web pages using Dreamweaver CS 5.5 and templates.Note to Students: Every student has access to web space on the Students server if thestudent has an active NetID. The NetID is the same as your Owl Express login. You musthave an active NetID before you can publish a web page to the Students server. If you donot have an active NetID, or have forgotten the password, you can go tohttps://netid.kennesaw.edu for assistance.Note to Faculty/Staff: If you are faculty or staff, you will need an account on the ksuwebserver. If you do not have an account on the ksuweb server, you can apply for an accountat http://its.kennesaw.edu/forms/account setup form.html.Caution: In this workshop you will be creating a website in your account on either the studentwebserver or the ksuweb server. If you have an existing website on this account, it will be overwritten. If youdo not want to overwrite the existing site, once you have defined your site, you can create a subfolder inyour account and put your website files there.Creating: When creating and editing a web page using Dreamweaver, you are editing files that are onthe computer in front of you. This computer is referred to as the local computer. You should create afolder on this local computer and keep all of the files related to your website (pages, images, etc.) in thislocal folder. In Dreamweaver, you look at the files in your local folder with the local view.Publishing: When you are finished editing the files that make up your website, you will need to sendthese files to your account on the web server. This computer is referred to as the remote computer. Theaction of sending these files is called publishing to the server, FTPing the files, or uploading the files tothe server. Dreamweaver calls this action “Put”. In Dreamweaver, you view the files on the web serverwith the remote view.Viewing: After publishing (putting) your web page files to your account on the web server, you will wantto check and see if they are working properly. To view your website, open a web browser and enter yourweb address in the address bar.Your web address on the Students server is http://studentweb.kennesaw.edu/ yournetidYour web address on the Faculty/Staff ksuweb server is http://ksuweb.kennesaw.edu/ usernameNote: Do not put any sensitive information on your website; even if there are no links to it from anotherweb page.1

Terms and DefinitionsWeb page – a web page is a document file just like a text file. It can be edited with Notepad, WordPad,or any text editor. The main difference between a web page and a regular text file is that a web page isformatted with HTML tags. This HTML formatting is what you see when you switch your web page fromthe Design view to the Code view.Website – a website is a collection of web pages that are usually linked together with hyperlinks.Hyperlink or Link– a section of text or image that appears colored and/or underlined on a web pagethat, when clicked, will take you to another web page.HTML – a hypertext markup language consisting of tags. HTML tells the web browser how to display thecontent of your web page.Web server – a computer or host for your website that makes your site publicly available on the web.If you are a student at KSU and have activated your NetID (https://netid.kennesaw.edu), you have webspace on the Students server http://studentweb.kennesaw.edu.If you are faculty/staff, you can apply for web space on the http://ksuweb.kennesaw.edu server.Web browser – an application or program that is installed on your computer that allows you to viewweb pages on the Internet (i.e. Internet Explorer, Mozilla Firefox, Google Chrome, Apple Safari).Index page – The index page is the main page of your website, also called homepage. This is the first pagethat people will see when they visit your site. When you create the index page you must save it asindex.html. Note: index.html must be spelled with all lower case letters.Put, Publish, or FTP- To send or upload your web page or pages to your account on the web server.Web address – a URL (Uniform Resource Locator) is the text you type into the address bar of your webbrowser to access a web page. For example: http://www.cnn.com. Your web address on the Studentsserver is http://studentweb.kennesaw.edu/ yournetID. The “yournetID” in this address refers to yourusername for the student email system, Owl Express, etc. Do not put www in this address. If you arefaculty/staff, your address will be http://ksuweb.kennesaw.edu/ username. The symbol (a.k.a. tilde)means home account.Template – Dreamweaver allows you to save a webpage as a template. You can add editable regions tothe template. Then you create web pages from the template. When you edit the template and save thechanges, Dreamweaver updates all of the pages that are created from the template. Anything that youadd to the template appears on every web page that is created from that template.2

File Naming ConventionsWhen naming your files, always use lowercase letters and avoid using spaces. For example, if building apage for course overviews it would be best to name the file “course overview.html” or“courseoverview.html” instead of “Course Overview.html”. The reason for this is that theKennesaw.edu server is based on a UNIX platform – what this means for you is that all files are casesensitive. If you have a file named “Course Overview.html” in your site and a user types in “courseoverview.html” the file WILL NOT come up.The rules for file naming are: Avoid uppercase lettersNo spacesSeparate words with hyphens or underscoresMain page is “index.html”Use shorter namesNo special characters such as question marks, exclamation points, dollar signs, symbols, etc.No punctuationDo not use numbers as the initial characterCreate a Local FolderIt is a good practice to create a local folder before you get started with Dreamweaver. This is yourworking directory. Dreamweaver refers to this folder as your local site. The local folder is usually a folderon your hard drive.To create a local folder:1. Right-click on your Desktop, and then click on New Folder.21Figure 1 - Create a Local Folder3

2. Give your new folder a name; something like “My Website”.Web ServersThere are five items that you will need to know before you can publish web pages to a web server, evenif it is your personal space on your home ISP account, such as AT&T, or Comcast.Items that you need to know to publish to a web server:1. Server Name: We will be using the Students server or the ksuweb server, so this will bestudentweb.kennesaw.edu or ksuweb.kennesaw.edu.2. Connection protocol: SFTP.3. Username: This is your NetID.4. Password: This will be the password for your NetID or the password for your ksuweb account.Note that your ksuweb account password is different than your NetID password.5. Root directory: For the Students server and the ksuweb server, this will be html/. For some webservers, this may be public html, or just public.The Dreamweaver EnvironmentDreamweaver is an application that helps you to create, edit, and manage web pages and websites.Dreamweaver provides you with a WYSIWYG (what you see is what you get) editing environment. Inother words, while editing your page, it looks like it will when viewed by a web browser. It also lets youeasily switch over to see and edit the HTML code of your web page if you so desire. Dreamweaver alsoprovides a publishing tool that helps you easily manage your files both locally and on your web server.4

Figure 2 - Dreamweaver EnvironmentDocument Toolbar - The Document toolbar allows you to access different views, preview your pages in abrowser, title your page, and upload files.Figure 3 - Document ToolbarThere are three working views: code, split, and design. The code view shows any source code for thepage. The design view shows the WYSIWYG page. The split view displays both the code and the designviews on the screen.Other elements of the document toolbar are the Live View, the “Earth” button, and the Title dialog box.The Live View displays a rendered view of how the page would like in a browser. The “Earth” button willshow a preview of the page in an actual browser. The Title dialog box allows you to add a title to thepage. This title will show at the top of browsers.Panels – Panels are sections of Dreamweaver that help you monitor and modify your work.The three panels that we will use the most are the Properties panel, the Files panel, and the InsertPanel. The Properties panel will show you all of the properties that can be set for the item(s) that areselected. The Files panel will allow you to easily open your local files for editing, and then “Put” or “Get”your files to and from the server. The Insert panel lets you insert objects, such as images, tables, andmedia files.To expand or minimize a panel: double-click on its tab. To turn off or on the panels: Press F4.5

Insert PanelFiles PanelProperties PanelPanelFigure 4 - PanelsDefining a SiteYou must define a site for each new website you create. A site in Dreamweaver is a collection of files andfolders (web pages, images, etc.) on your personal computer, and a link to your web space on theInternet. As you create and edit your web pages, you will be working on files on this local site. Whenyour pages are finished and ready to be viewed on the Internet, Dreamweaver gives you the ability to“Put” these files from your local site onto your web space (the remote site).Note: You should create a local folder for your web pages and have access to an account on a webserver before you can define a Site.To define a Site:1. Start Dreamweaver and select Site from the Menu bar.2. Click on New Site This will start the Site Setup wizard.Figure 5 - Site Menu6

3. Enter a name for your site in the Site Name field. The Site Name is used only for identifying the sitewithin Dreamweaver so choose a name that will help you recognize the site later.4. Click on the folder iconnext to the Local Site Folder text box. (See Figure 6)Figure 6 - Site Setup - Site5. Use the File dialog to navigate to your local folder, click on Open, and then click on Select.6. Verify that your local folder appears in the Local Site Folder text box.Figure 7 - Local Site FolderTo be able to publish your files to the web, you must enter the remote server information.Note: You do not need to complete the next steps to begin working on your Dreamweaver site. Youonly need to define a remote server when you want to connect to the web and publish your pages. Ifyou ready to begin working on your site, click on the Save button.To define the Remote Server:7. Select Servers from the left side menu.Figure 8 - Servers Menu7

8. Click on the sign iconat the bottom-left corner of the blank text area to add a new server. (SeeFigure 9)Figure 9 - Add New Server8

A pop-up dialog with the Basic tab selected appears.Figure 10 - Basic Tab of the Add Server Dialog Box9. Provide a Server Name. The Server Name is only used within Dreamweaver so you should provide aname that is meaningful to you.10. Select SFTP from the Connect using: drop-down menu. “SFTP” stands for Secure File TransferProtocol.Figure 11 - Connect using SFTP11. Type in the SFTP Address. The SFTP address for students is studentweb.kennesaw.edu.The SFTP address for faculty and staff is ksuweb.kennesaw.edu.9

12. Enter your username and password. The username and password for students is their NetID and their NetID password.The username and password for faculty and staff is their NetID and their ksuwebpassword.Note: When you enter a password, Dreamweaver automatically checks the Save box to the rightof the password field. Unchecking the option deletes your password. If you are a student using acomputer in one of the campus labs, be sure to un-check the “Save” check box so that otherstudents using the computer you are sitting at will not have access to your web space. If you arefaculty/staff, and are using the computer in your office, you may want to leave this box checked.If you un-check this box, Dreamweaver will ask you for your password every time you try toaccess your site.Your password must be entered in order to test your connection. So enter it now. Later, after youhave successfully tested your connection, make sure to uncheck the Save (password) option ifyou are on a lab computer.13. Enter html/ in the Root Directory text box. It is important that this be exactly as shown, or else itmay not work properly. The Root Directory is the actual folder on the server where your site willreside.14. You can test the connection by clicking on the Test Connection button.14.1.If you get a message saying that Dreamweaver connected successfully, click OK.Figure 12 - Successful Connection Test14.2.If you get an error message, click OK, and then repeat steps 10 through 14 to verify thatthe information was entered correctly. Note that the server information is case sensitive.If you still cannot successfully connect to the server, contact the KSU Service Desk forassistance.Figure 13 - Connection Test Error Example15. Enter your website address in the Web URL text box. The Web URL for students is http://studentweb.kennesaw.edu/ yournetidThe Web URL for faculty and staff is http://ksuweb.kennesaw.edu/ yournetid10

Figure 14 - Server Definition16. Click on the Save button.The server now appears on the Servers list.Figure 15 - Servers17. If you need to make changes to the server definition, you may click on the pencil icon below the textbox. (See Figure 16)Figure 16 - Edit Existing Server11

18. Click the Save button.The Manage Sites window appears.19. Click the Done button.Connecting to Server1. To see your site and all of the files that it contains, go to the Files panel. You should to see your newsite in the left drop-down menu. The right drop-down menu allows you to toggle the local andremote server views, as well as offering a few more advanced views.Figure 17 - Views Drop-Down Menu in Files PanelThe different view options are: Local view: Shows the copies of the files for your website which are located on your localmachine.Remote view: Shows the copies of the files for your website which are stored on the Internetserver that is providing access to your site to users.Testing server: An advanced feature which would show the files which are being stored on a testserver (We do not use this feature).Repository view: Shows a listing of all the files in the repository when working with Subversion, aversioning control system. (We do not use this feature).2. To see your remote files, click on the Connect to Server buttonthen select Remote server from the views drop-down menu.in the Files panel toolbar, andNote: if you see an index.html file on the remote site, it is just a placeholder. You will be replacing it withyour own custom home page.3. Select Local view from the views drop-down menu to display the local site again.Note: If you are working at a computer that does not have the local folder with your website files in it,you can create a local folder, define the site on this computer, and then download the files from youraccount on the server, by clicking on the Get arrow (see Figure 18).12

Figure 18 - Get Files from ServerYou are now ready to design your web pages.Designing Your SiteIt is always a good idea to take a little time to think about your website design before creating the firstpage. Design work will save time, especially if you anticipate a large site with many pages.A good design practice is to have each page of the site have some common elements such as images,colors, borders, and navigation tools. This design philosophy results in the existence of two types ofelements, elements that are on every page of a website (common elements), and elements that are ononly one web page of a website (unique elements). This design philosophy is the foundation of thetemplate.When designing a website with a template, you put elements that will appear on every page of awebsite on the template, and you put elements that appear only on one page of a website on a webpage created from the template. Any web pages created from a template will inherit common elementsfrom the template.Another consideration is layout; in other words, where will the common elements be placed on thepages, and where will the unique elements be placed. The common elements should be on thetemplate, and the unique elements should be on each individual page.In this case, we will use a table with three rows and three columns, similar to the one below:Common ElementsCommonElementsUnique ElementsCommon ElementsFigure 19 - Template Table13

Creating the TemplateA template is a common structure of a website that is used by most web pages. Once a template hasbeen created, you can create new web pages based on that template. All of the pages created from atemplate will have everything that is on the template plus whatever you add to that particular page.Additionally, whenever a change is made to the template, such as the addition of a new image ornavigation link, these pages will be updated automatically.Note: Remember, only the elements that are common to all web pages in our website should be on thetemplate. Do not put unique content on this page.Note: You can have multiple templates for your website. For example, large websites, such as one for auniversity, may have different templates for each department or section of the institution.To create the template:1. Go to the File menu, and choose New. The New Document window appears.2. Choose Blank Template.3. Select HTML template in the Template Type: column.4. Select none in the Layout: column.5. Click on the Create button.Figure 20 - New Blank HTML Template14

A blank, untitled template page appears.6. Type in a Title for your template. This title will be inherited by each page that is created from thistemplate.Figure 21 - Template Title7. Insert a table by going to the Insert menu, and selecting Table.Figure 22 - Insert Table8. Build the table.8.1. Use 3 rows by 3 columns.8.2. Set the table width to 100 percent.8.3. Set the Border thickness, Cell padding, and Cell spacing all to zero.8.4. Click the OK button.Figure 23 - Table PropertiesThe table appears on the web page.15

Figure 24 - Table9. Expand the table to fill the page with a header, footer, a right margin, and a left margin, according toour design (see Figure 26), by dragging the dotted lines (see Figure 25).Hint: The height of the table may be set to about 900 pixels.Figure 25 - Expanding Rows and ColumnsFigure 26 - Expanded Table10. You can select the table by clicking in one of the cells of the table and then going to Modify Table Select Table. Once you select the table, the Properties panel changes to show the properties ofthe table.16

Figure 27 - Table Properties11. Change the table alignment from Default to Center.Figure 28 - Table Alignment12. Insert text into the header of your page by clicking in the top center cell of your table.Figure 29 - Header Text13. The properties panel changes from table to text properties. Remember, the text you enter willappear at the top of every page created from this template.Figure 30 - Text PropertiesWe are going to define the properties for the text in the header, such as text font, background imageand color, spacing, layout, and the appearance of its elements by creating a Cascading Style Sheet (CSS)rule.14. Select CSS on the properties panel. The CSS properties appear.Figure 31 - CSS Properties15. Click on Edit Rule.17

The New CSS Rule window appears.Figure 32 - New CSS Rule16. Leave the Selector Type as Class.17. Enter a name for the selector. In our example, the name is Site Header.18. Click OK. The CSS Rule definition for .Site Header window appears.Figure 33 - CSS Rule definition18

19. From the Type category, define the basic font and type settings. See our example in Figure 34.Figure 34 - CSS Rule Type20. Select Background from the Category list, and choose a background color or image for the headercell. Enter additional background settings as needed. See our example in Figure 35.Figure 35 - CSS Rule Background19

21. Select Block from the Category list and set your spacing and alignment preferences; including centeras Text-align. See our example in Figure 36.Figure 36 - CSS Rule Block22. Select Box from the Category list to define settings that control the placement of elements in theheader. These properties are left blank in our example in Figure 37.Figure 37 - CSS Rule Box20

23. Select Border from the Category list to define settings such as width, color, and style, for the borderaround the header. These properties are left blank in our example in Figure 38.Figure 38 - CSS Rule Border24. Click on OK. The header is now formatted based on the new CSS rule as seen in Figure 39.Figure 39 - Formatted Text25. Change the background color of the cells in the table by clicking in each cell of the table and usingthe Bg color palette on the Cell properties panel.Figure 40 - Bg Color Palette21

Note: If the Cell Properties panel does not appear below the text properties panel when you click on acell, expand the properties pane by clicking on the arrow pointerproperties pane. (See Figure 41)in the lower right corner of theFigure 41 - Text Properties OnlyFigure 42 - Text and Cell PropertiesTo apply the background color of the header into another cell:25.1. Place your cursor in the cell for which background color needs to match the headerbackground.25.2. Click on the Bg color palette. The mouse cursor turns into a dropper.25.3. Click on the background of the header’s cell.25.4. The background is applied to the other cell.Figure 43 - Cell Background Color26. Insert text as a footer at the bottom of the page. This footer will appear at the bottom of every pagethat is created from this template. Create a new CSS rule to format the text.Figure 44 - FooterNote the copyright symbol ( ) used in the footer was obtained from the Insert Menu HTML Special Characters.22

27. Insert text that will later become navigation links in the center left cell of the table. When you click inthe center left cell, change the vertical alignment to “Top”.Figure 45 - Vertical Cell AlignmentNote: In our example, we will eventually create 3 web pages from this template. As such, there will bethree links to point to the 3 different pages (Home, Biography, and Resume). Create a new CSS rule toformat the navigation links menu.Figure 46 - Navigation Links MenuNote: The horizontal lines in the Navigation Menu cell are horizontal rules. To draw a horizontal line, goto the Insert Menu, click on HTML, and then select Horizontal Rule.28. Save the template page. Click on File, and then on Save as a Template. In our example, the templatename is “MainTemplate”. If you know that you will have multiple templates, you should give it aname that will indicate what the template is used for.29. Click in the center cell of the table, change the vertical alignment to “Top”, and insert an EditableRegion in the cell by going to the Insert Menu, clicking on Template Objects, and then selectingEditable Region. You can name your editable region whatever you want. In our example, theregion’s name is “Edit Here”.23

Note: Editable template regions control which areas of the template you can edit on the individual webpages based on the template.Figure 47 - Editable Region30. Save the page again.31. Leave the template open; we will work on it more as we go. After we create web pages from thistemplate, we will come back and create links from the template to each page.Creating a New Web Page from a TemplateOnce you have created a template, you can create one or more web pages from that template. In ourexample, we will create three web pages from the template that we just created.Note: Remember, any elements that are unique to one web page should be added to the web page thatis created from the desired template.1. Go to the File Menu.2. Click on New.3. Select Page from Templates.4. Select the Site on which you are working.24

5. Select the Template from which you wish to create a page.6. Click the Create button.3214Figure 48 - New Page from TemplateThe new page based on the template appears.7. Click in the Editable Region on the page and enter content: text, tables, and images. Any contentthat you add to this page will be unique to this page. Create new CSS rule for the body text.Note: When entering text, pressing the Enter key skips a line to start a new paragraph. If you do notwant to skip a line, press Shift Enter.25

Figure 49 - Text in Editable Region8. Save the page by going to the File Menu and selecting Save.9. The first page (Home) must be saved as index.html. All other pages should have a meaningful namethat is short, yet descriptive of the page (e.g. biography.html).Note: The filename is different from the title. The title determines what appears in the status bar of avisitor’s web browser, while the filename is the actual name of the file on the computer.10. Repeat the steps 1 through 9 to create additional web pages. In our example, two additional pagesare created: biography.html and resume html.26

Adding Images to a Web Page or TemplateBefore you can add an image to a web page or template, you will need to have the image file on yourlocal computer, preferably in a subfolder of your local web folder.Dreamweaver accepts the following image formats: .gif, .jpg, .png, and .psd.To insert an image:1. Create a subfolder in your local web folder called “images”, and then copy the image file into thissubfolder.2. Open the web page in which you wish to insert an image.3. Click where you want to insert the image. The image will appear at your insertion point.4. Go to the Insert Menu.5. Click on Image.The Select Image Source window appears.6. Navigate to the “images” subfolder in your local web folder.7. Select the image file and click OK.Figure 50 - Select Image Source27

The Image Tag Accessibility Attributes window appears.When used, the alternate text attribute displays a tooltip in Internet Explorer with the words youentered for the website visitors when they place their cursor over the image. Not only is thi

Template - Dreamweaver allows you to save a webpage as a template. You can add editable regions to the template. Then you create web pages from the template. When you edit the template and save the changes, Dreamweaver updates all of the pages that are created from the template. Anything that you