Using two HTMl-Nuggets makes page invalid

Found a bug? Tell us!!
Post Reply
seraphyn
Regular
Posts: 211
Joined: Fri Dec 01, 2006 8:42 am
Contact:

Using two HTMl-Nuggets makes page invalid

Post by seraphyn »

Hi,

I don't know if it's a bug or an PEBKAC.
I'm using to HTML-Nuggets for selfwritten text in my sidebar at the bottom and the Validator gives me an:
Line 910, Column 14: ID "serendipity_html_nugget_plugin" already defined
<div id="serendipity_html_nugget_plugin" class="sbitem">

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 hook 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 900, Column 14: ID "serendipity_html_nugget_plugin" first defined here
<div id="serendipity_html_nugget_plugin" class="sbitem">
One is for Textinformation and one for links.
If it's not my fault could it be possible to generate one more class with the title shortened for the item?

Thx in advance
chris
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: Using two HTMl-Nuggets makes page invalid

Post by garvinhicking »

Hi!

Which template are you using? This is happening because in the sidebar.tpl file of your template a ID is given, probably to support specific styling of special plugin outputs. Since the nugget plugin can be used multiple times, that causes a problem.

It would be better to apply the unique styling through a div.class instead of div.id...

Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
seraphyn
Regular
Posts: 211
Joined: Fri Dec 01, 2006 8:42 am
Contact:

Re: Using two HTMl-Nuggets makes page invalid

Post by seraphyn »

ahhh, I'll have a look.
Selfwritten Template.
In this case PEBKAC...:)
Thx
seraphyn
Regular
Posts: 211
Joined: Fri Dec 01, 2006 8:42 am
Contact:

Re: Using two HTMl-Nuggets makes page invalid

Post by seraphyn »

Code: Select all

#sidebar_top .sbitem {
float:left;
width: 48%;
margin: 5px;
}
Using this code and more not.
does this one provides the error?
yellowled
Regular
Posts: 7111
Joined: Fri Jan 13, 2006 11:46 am
Location: Eutin, Germany
Contact:

Re: Using two HTMl-Nuggets makes page invalid

Post by yellowled »

garvinhicking wrote:It would be better to apply the unique styling through a div.class instead of div.id...
Another possibility is to assign unique ids to HTML nuggets in the sidebar.tpl using a smarty counter, but that's usually only desirable if various nuggets need individual styling. Also note that multiple instances of the same id are invalid HTML, so Garvin's class suggestion is really the better idea.

YL
seraphyn
Regular
Posts: 211
Joined: Fri Dec 01, 2006 8:42 am
Contact:

Re: Using two HTMl-Nuggets makes page invalid

Post by seraphyn »

But the ID is from placing the plugin in the administratorpage?
Isn't it?
greetings
chris
yellowled
Regular
Posts: 7111
Joined: Fri Jan 13, 2006 11:46 am
Location: Eutin, Germany
Contact:

Re: Using two HTMl-Nuggets makes page invalid

Post by yellowled »

seraphyn wrote:But the ID is from placing the plugin in the administratorpage?
No. If this

Code: Select all

<div id="serendipity_html_nugget_plugin" class="sbitem">
is the result, it's very likely your sidebar.tpl has something like this in it:

Code: Select all

<div id="{$item.class}" class="sbitem">
That's fine as long as you don't have any plugins in the sidebar which allow multiple instances like the HTML nugget plugin. I used to use similar code in my blog, but I didn't use HTML nuggets. As the name of the variable indicates, $item.class is supposed to be assigned as a class, not an id.

YL
seraphyn
Regular
Posts: 211
Joined: Fri Dec 01, 2006 8:42 am
Contact:

Re: Using two HTMl-Nuggets makes page invalid

Post by seraphyn »

Ahhhh, Okay.
So I need to change this...
Thanks
seraphyn
Regular
Posts: 211
Joined: Fri Dec 01, 2006 8:42 am
Contact:

Re: Using two HTMl-Nuggets makes page invalid

Post by seraphyn »

Works :)
Thanks, hope that I finish this theme until the next 2 months.
Greetings Chris
yellowled
Regular
Posts: 7111
Joined: Fri Jan 13, 2006 11:46 am
Location: Eutin, Germany
Contact:

Re: Using two HTMl-Nuggets makes page invalid

Post by yellowled »

seraphyn wrote:Thanks, hope that I finish this theme until the next 2 months.
Don't forget to show it off in the Showcase or Themes (if you make a public release) forum. :)

YL
seraphyn
Regular
Posts: 211
Joined: Fri Dec 01, 2006 8:42 am
Contact:

Re: Using two HTMl-Nuggets makes page invalid

Post by seraphyn »

Should be a public release.
But that what would like to do ain't to be easy, but I'm a perfectionist lol.
At the moment I'm fighting with the CSS3 floats etc... but I see a light at the end of the tunnel and this ain't to be a train... hope so lol
Post Reply