HighDots Forums  

Validating an Include

Macromedia Dreamweaver Macromedia Dreamweaver Discussions (macromedia.dreamweaver)


Discuss Validating an Include in the Macromedia Dreamweaver forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Chris \(Hunt\)
 
Posts: n/a

Default Validating an Include - 11-14-2004 , 02:35 AM






I have a div with a menu bar that I'd like to use as a php include so I can
easily change the menu as the site grows. When I use teh 3WC validator I get
14 error messages. There are two kinds, "already defined" and "first defined
here". For example:


Line 200, column 8: ID "NAVLIST" already defined
<ul id="navlist">
An "id" is a unique identifier. Each time this attribute is used in a
document it must have a different value. If you are using this attribute as
a hock for style sheets it may be more appropriate to use classes (which
group elements) than id (which are used to identify exactly one element).

Line 184, column 8: ID "NAVLIST" first defined here
<ul id="navlist">

I find this confusing. Can anyone please tell from this what I have done
wrong?

Thanks,

Chris (Hunt)



Reply With Quote
  #2  
Old   
Dan Vendel *GOF*
 
Posts: n/a

Default Re: Validating an Include - 11-14-2004 , 02:48 AM






Chris (Hunt) wrote:
Quote:
I have a div with a menu bar that I'd like to use as a php include so I can
easily change the menu as the site grows. When I use teh 3WC validator I get
14 error messages. There are two kinds, "already defined" and "first defined
here". For example:


Line 200, column 8: ID "NAVLIST" already defined
ul id="navlist"
An "id" is a unique identifier. Each time this attribute is used in a
document it must have a different value. If you are using this attribute as
a hock for style sheets it may be more appropriate to use classes (which
group elements) than id (which are used to identify exactly one element).

Line 184, column 8: ID "NAVLIST" first defined here
ul id="navlist"

I find this confusing. Can anyone please tell from this what I have done
wrong?

Thanks,

Chris (Hunt)


The validator sees the same id (#NAVLIST) twice on the same page. If
that's not your intention, make it a class, i.e. with a dot before in
the stylesheet (.NAVLIST) and thn you probably need to change the
objects' tags to have class="NAVLIST" instead of id="NAVLIST".

However, show the URL so that we can see the code. Else, the above is
merely a guess.

--
Dan Vendel - *GOF*
"Eagles may soar, free and proud, but weasels never get sucked into jet
engines."
Contact: http://www.proformica.com/contact.shtml
Call or chat me via Skype ID: danvendel, but DON'T ask questions that
you can ask here! (get Skype at http://skype.com)


Reply With Quote
  #3  
Old   
Chris \(Hunt\)
 
Posts: n/a

Default Re: Validating an Include - 11-14-2004 , 02:53 AM



Thanks for the reply. The url is:

http://www.wisehat.com/resources/games/bombsaway.php

Chris


"Dan Vendel *GOF*" <see_my_signature_ (AT) _the_bottom_of_the_po (DOT) st> wrote in
message news:cn72kv$77b$1 (AT) forums (DOT) macromedia.com...
Quote:
Chris (Hunt) wrote:
I have a div with a menu bar that I'd like to use as a php include so I
can easily change the menu as the site grows. When I use teh 3WC
validator I get 14 error messages. There are two kinds, "already defined"
and "first defined here". For example:


Line 200, column 8: ID "NAVLIST" already defined
ul id="navlist"
An "id" is a unique identifier. Each time this attribute is used in a
document it must have a different value. If you are using this attribute
as a hock for style sheets it may be more appropriate to use classes
(which group elements) than id (which are used to identify exactly one
element).

Line 184, column 8: ID "NAVLIST" first defined here
ul id="navlist"

I find this confusing. Can anyone please tell from this what I have done
wrong?

Thanks,

Chris (Hunt)

The validator sees the same id (#NAVLIST) twice on the same page. If
that's not your intention, make it a class, i.e. with a dot before in the
stylesheet (.NAVLIST) and thn you probably need to change the objects'
tags to have class="NAVLIST" instead of id="NAVLIST".

However, show the URL so that we can see the code. Else, the above is
merely a guess.

--
Dan Vendel - *GOF*
"Eagles may soar, free and proud, but weasels never get sucked into jet
engines."
Contact: http://www.proformica.com/contact.shtml
Call or chat me via Skype ID: danvendel, but DON'T ask questions that you
can ask here! (get Skype at http://skype.com)



Reply With Quote
  #4  
Old   
Dan Vendel *GOF*
 
Posts: n/a

Default Re: Validating an Include - 11-14-2004 , 04:16 AM



Chris (Hunt) wrote:

Quote:
Thanks for the reply. The url is:

http://www.wisehat.com/resources/games/bombsaway.php
Yes, an "id", i.e. a style that you define with a #, is only supposed to
occur once on each page. In your case, it appears several times. Make it
a class instead, since that allows you to apply it on as many elements
as you wish.

Try this:

In the stylesheet, change all instances
#navlist
to
..navlist

In the pages (and includes), change:
id="navlist"
to:
class="navlist"

I think that'll do. But I'm not a CSS guru, so try and see what happens,
then check back here if the more knowledgeable people have made any
comments.

--
Dan Vendel - *GOF*
"Eagles may soar, free and proud, but weasels never get sucked into jet
engines."
Contact: http://www.proformica.com/contact.shtml
Call or chat me via Skype ID: danvendel, but DON'T ask questions that
you can ask here! (get Skype at http://skype.com)


Reply With Quote
  #5  
Old   
Chris \(Hunt\)
 
Posts: n/a

Default Re: Validating an Include - 11-14-2004 , 07:06 AM



Thanks Dan,

You were right - making the changes you suggested allows the page to
validate. Unfortunately it also means I lose the colour scheme. I had this
#navtitle and #navlist. Both repeated. I changed them to classes but the
background colour of #navtitle changed and all the text changed colour as
well. I can't work out how to change it to what I want without repeating ids
which means it won't validate.

Chris


"Dan Vendel *GOF*" <see_my_signature_ (AT) _the_bottom_of_the_po (DOT) st> wrote in
message news:cn77ph$77b$2 (AT) forums (DOT) macromedia.com...
Quote:
Chris (Hunt) wrote:

Thanks for the reply. The url is:

http://www.wisehat.com/resources/games/bombsaway.php

Yes, an "id", i.e. a style that you define with a #, is only supposed to
occur once on each page. In your case, it appears several times. Make it a
class instead, since that allows you to apply it on as many elements as
you wish.

Try this:

In the stylesheet, change all instances
#navlist
to
.navlist

In the pages (and includes), change:
id="navlist"
to:
class="navlist"

I think that'll do. But I'm not a CSS guru, so try and see what happens,
then check back here if the more knowledgeable people have made any
comments.

--
Dan Vendel - *GOF*
"Eagles may soar, free and proud, but weasels never get sucked into jet
engines."
Contact: http://www.proformica.com/contact.shtml
Call or chat me via Skype ID: danvendel, but DON'T ask questions that you
can ask here! (get Skype at http://skype.com)



Reply With Quote
  #6  
Old   
Larry
 
Posts: n/a

Default Re: Validating an Include - 11-14-2004 , 11:34 AM



On Sun, 14 Nov 2004 21:06:43 +0900, Chris (Hunt) wrote:

Quote:
Thanks Dan,

You were right - making the changes you suggested allows the page to
validate. Unfortunately it also means I lose the colour scheme. I had this
#navtitle and #navlist. Both repeated. I changed them to classes but the
background colour of #navtitle changed and all the text changed colour as
well. I can't work out how to change it to what I want without repeating ids
which means it won't validate.

Chris
I'm far from a CSS guru either, but I think I can help. If you open the
page in Dreamweaver MX2004, there will be a panel called "Relevant CSS".
When you select either part of navTitle and navlist, that Relevant CSS will
tell you which CSS applies. That should help you fix the cascade. It
might just be as simple as a reordering of the sheets in <head></head>
section.

--

Larry
email is rapp at lmr dot com
11/14/04 11:31:43 AM


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.