Wrox Programmer Forums
|
BOOK: Beginning Dreamweaver MX/MX 2004 MX ISBN: 978-0-7645-4404-0; MX 2004 ISBN: 978-0-7645-5524-4
This is the forum to discuss the Wrox book Beginning Dreamweaver MX by Charles E. Brown, Imar Spaanjaars, Todd Marks; ISBN: 9780764544040
Please indicate which version of the book you are using when posting questions.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning Dreamweaver MX/MX 2004 MX ISBN: 978-0-7645-4404-0; MX 2004 ISBN: 978-0-7645-5524-4 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old September 16th, 2003, 07:17 AM
Registered User
 
Join Date: Sep 2003
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default Chapter Eight bold home link

I am having difficulties with this.

Code enclosed, cannot get 'Home' to bold.

I also, as a pointer do not get the message box on page 271 to appear.
When I create the library item it tells me that styles will not be included. I assume this is because the CSS styles are not selected as they are above the table code.

<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>

<title>GlobalSoccerEvents.com - Your Source for Soccer Events Around the Globe</title>

<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />

<style type="text/css">
<!--
td {
    font-family: Arial, Helvetica, sans-serif;
    color: #000000;
}
a {
    font-family: Arial, Helvetica, sans-serif;
    color: #669933;
}
-->
</style>
</head>

<body>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td><img src="../images/logo.gif" />&nbsp;</td>
    <td><table border="0" align="right" cellpadding="0" cellspacing="0">
  <tr>
    <td><a href="../home.asp" id="home">Home</a></td>
    <td>&nbsp;&nbsp;&nbsp;</td>
    <td><a href="../events.asp" id="events">Events</a></td>
    <td>&nbsp;&nbsp;&nbsp;</td>
    <td><a href="../mySite" id="mysite">My Site</a></td>
  </tr>
</table></td>
  </tr>
</table>
<br />

<script language="JavaScript" type="text/javascript">
    var sPageName = '<%=Request.ServerVariables("SCRIPT_NAME")%>';
    sPageName = sPageName.substr(sPageName.lastIndexOf('/') _
                                                     + 1).toLowerCase();
    sPageName = sPageName.substr(0, sPageName.lastIndexOf('.'));
    if (document.getElementsById(sPageName))
    {
        document.getElementById(sPageName).style.fontWeigh t = 'Bold';
        document.getElementById(sPageName).style.fontSize = '14pt';
    }
</script><table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td><h2>- Page Title Here -</h2></td>
    </tr>
  <tr>
    <td>- Page Content Here -</td>
    </tr>
  <tr>
    <td align="center"><br /> <br /> <br /> <br /> <br />
      - Footer Here -</td>
  </tr>
</table>
</body>
</html>
 
Old September 16th, 2003, 07:38 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Hi there,

The problem you have is caused by a print error in the book. Take a look at the following line:

sPageName = sPageName.substr(sPageName.lastIndexOf('/') _
                   + 1).toLowerCase();

The underscore is a VB Script way to break up a line, and not a JavaScript one. Change it to this:

sPageName = sPageName.substr(sPageName.lastIndexOf('/') + 1).toLowerCase();

This should all be on one line.......

Take a look at the errata section for other errors that have been discovered after the book was published.

The warning about the style is correct. You copy just the menu code and not the style definition to the Library Item. Since DW cannot guarantee that you are reusing the Library Item on another page with the exact same style definition, it warns you that it might end up look different. No problem, you can simply click OK. The styles will be used throughout TheSoccerSite consistently, so it's no problem here.

Regards,

Imar




---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
 
Old September 17th, 2003, 05:18 AM
Registered User
 
Join Date: Sep 2003
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks Imar, the code now works;:D sorry did not see the errata.
Just as an aside, but not too important, any idea why I do not get the message box from page 271 appear?

 
Old September 17th, 2003, 06:23 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Hi,

I don't have the book here right now, so I am not sure what the problem is. You either have to wait a couple of hours till I am at home, or post the code here so I can take a look at it.

Cheers,


Imar


---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
 
Old September 17th, 2003, 11:21 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

OK, back home with the book. I have seen the error message on page 271.

The error message tells you about placing an editable region inside a <p> or other block tag. I think the only reason you don't get that message is because you haven't placed the editable region in a block tag (duh ;) )

If you look at the code you'll see this:

Code:
 
    <td><h2>- Page Title Here -</h2></td>
    <!-- TemplateEndEditable --
    As you can see, not just the <h2> is inside the editable region, but the entire <td> with the <h2> is. Step 5 on page 263 instructs you to select the entire contents of the table cell in Design View. When you do that, Dreamweaver will just select the contents of the <h2> tag. If you then apply the editable region, this is what you'll end up with:

Code:
<td><h2>

- Page Title Here -

</h2></td>
The advantage of this, is that the users of your template can no longer delete or change the <h2> or <td> tags. All they can do is change the actual title. This will ensure a consistent look in your site.

Does this make sense? If not, please let me know.

Cheers,


Imar



---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
 
Old September 18th, 2003, 04:55 AM
Registered User
 
Join Date: Sep 2003
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Imar, you're a god.:)
Everything works wonderfully.
Once again thanks for your help and I
apologise for being new to the subject.

 
Old September 18th, 2003, 06:20 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

There is no reason to apologize for being new to a subject. How, else, can anybody ever learn a new topic?

Glad it worked, and if you have other issues with the book or Dreamweaver, please post them here.

Cheers,

Imar


---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.





Similar Threads
Thread Thread Starter Forum Replies Last Post
How to Link User control Form to Home page Dhanapal ASP.NET 1.0 and 1.1 Basics 1 March 12th, 2007 05:30 PM
Pivot Subtotals in Bold paul20091968 Excel VBA 0 June 29th, 2006 07:03 AM
making a link bold knalle HTML Code Clinic 5 November 12th, 2004 11:46 AM
Bold Words in Strings SerranoG Access VBA 6 September 24th, 2004 06:46 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.