On Wed, Mar 5, 2014 at 8:44 PM, Andrea Del Bene <an.delb...@gmail.com>wrote:
> Hi, > > what you miss now are attribute modifiers to change the value of meta tag > attributes. For example if you want to change the content of attribute > 'content' you can use the following label and attribute modifier: > > new Label("ogTitle").add(AttributeModifier.replace("content", "Title for > facebook")) > Better create custom component by extending WebComponent and overriding #onComponentTag() to add the attributes. It is much lighter than adding behavior. But maybe this is too advanced for now... > > The final markup will be: > > <meta property="og:title" content="Title for facebook" wicket:id="ogTitle" > /></meta> > > >> . >> I try to use Label with one item but it doesn't change meta tags, but >> simply write text on rendered webpage as first line. >> >> html code: >> >> ... >> <meta property="og:type" content="website static" /> >> <meta property="og:title" content="title" wicket:id="ogTitle" /> >> ... >> >> java code: >> ... >> public class Facebook extends Panel implements Serializable >> { private static final long serialVersionUID = 1L; >> >> public Facebook(String id, String query, String in) >> { >> super(id); >> add(new Label("ogTitle","Title for facebook")); >> } >> } >> >> >> And this is the soucecode of the rendered webpage: >> ... >> <meta property="og:type" content="website static" /> >> <meta property="og:title" content="title" wicket:id="ogTitle">Title for >> facebook</meta> >> >> <meta ... >> >> >> >> If I remove content="title" it is almost the same: >> ... >> <meta property="og:type" content="website static" /> >> <meta property="og:title" wicket:id="ogTitle">Title for facebook</meta> >> <meta ... >> >> >> --------------------------------------------------------------------- >> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org >> For additional commands, e-mail: users-h...@wicket.apache.org >> >> > > --------------------------------------------------------------------- > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org > For additional commands, e-mail: users-h...@wicket.apache.org > >