Hi,
On Thu, Aug 29, 2013 at 3:29 PM, Dirk Forchel <dirk.forc...@exedio.com>wrote: > I'm currently try to add some kind of microdata > (http://en.wikipedia.org/wiki/Microdata_%28HTML%29) to our project. > Exists a > wicketstuff project dealing with this problem? > I'm not aware of such. > What is the preferred way to add "valueless" attributes to HTML tags? E.g. > I > have to add the following attributes to the body tag: > > <body id="foo" itemscope itemtype="http://scheme.org/WebPage"> > > </body> > > At the base page class I've added a TransparentMarkupContainer the > following > way: > > this.body = new TransparentWebMarkupContainer("body"); > this.body.setOutputMarkupId(true); > > HTML: > > <body wicket:id="body"> > <wicket:child/> > </body> > > At a subclass I did: > > getBody().setMarkupId("foo").add( AttributeModifier.append("itemscope", > AttributeModifier.VALUELESS_ATTRIBUTE_ADD ) ).add( > AttributeModifier.append( > "itemtype", Model.of( "http://scheme.org/WebPage" ) ) ); > > Is this the preferred way to add "valueless" attributes to a tag (I've > never > Yes. This is the way to tell Wicket to not add a value for the attribute. Another way is to add these attributes directly in the markup. No need to add Behavior to the components for something that is always true. > seen this before)? Or is this marker value for internal use only? At least > the generated HTML code looks like intended. > I would like to know whether there is a kind of general solution to deal > with "microdata", say a bunch of Behavior-classes to add this kind of data. > AttributeModifier is a Behavior itself. There is no special code in Wicket for microdata. This specification is not broadly used. > > > > -- > View this message in context: > http://apache-wicket.1842946.n4.nabble.com/Wicket-and-microdata-tp4661135.html > Sent from the Users forum mailing list archive at Nabble.com. > > --------------------------------------------------------------------- > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org > For additional commands, e-mail: users-h...@wicket.apache.org > >