You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by - <ir...@gmail.com> on 2014/03/02 16:00:39 UTC

How to set meta tags prroperty for facebook and Open Graph?

I need to set meta tag property as I want for facebook and OpenGraph with wicket.

<meta property="fb:app_id" content="117243945141208" />
<meta property="og:site_name" content="site.com" />
<meta property="og:type" content="website" />
<meta property="og:title" content="title variable" />
<meta property="og:url" content="http://www.site.com/......" />
<meta property="og:description" content="Description variable" />
<meta property="og:image" content="http://www.site.com/images/...." />

An example code is welcomed because I am a newbie. Thanks.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: How to set meta tags prroperty for facebook and Open Graph?

Posted by Martin Grigorov <mg...@apache.org>.
On Wed, Mar 5, 2014 at 8:44 PM, Andrea Del Bene <an...@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-unsubscribe@wicket.apache.org
>> For additional commands, e-mail: users-help@wicket.apache.org
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

Re: How to set meta tags prroperty for facebook and Open Graph?

Posted by Andrea Del Bene <an...@gmail.com>.
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"))

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-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: How to set meta tags prroperty for facebook and Open Graph?

Posted by - <ir...@gmail.com>.
On Wednesday 05 March 2014 08:54:44 Martin Grigorov wrote:

> >
> > BUT IT IS STILL STATIC, HOW I CAN MODIFY IT DINAMICALLY INTO THE JAVA CODE?
> > I am sorry but I am new in wicket and it results so difficult for me. In
> > PHP I can do it so quickly.
> >
> 
> New in Wicket: http://markmail.org/message/efxl7bgzfd3sy2ga
> For 3 years experience with Wicket you should have heart of Label component
> and models.
Yes, ok. But I use wicket for hobby, it is not my daily work.
I already use Label, but for write text into the page.
The Models in wicket is still a misterius for me, I read books, docs, but I still
not undenstand models, so I use it just as I see on docs, but I don't know how it works exatly.
If you can help me, I will appreciate a lot.

> The Hello World example shows how to use Label -
> http://wicket.apache.org/guide/guide/helloWorld.html#helloWorld_3
> Use a Label for each <meta> and use .setVisible(false) if any of them
> should be hidden when there is novalue for it.

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-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: How to set meta tags prroperty for facebook and Open Graph?

Posted by Martin Grigorov <mg...@apache.org>.
Hi,


On Wed, Mar 5, 2014 at 4:15 AM, - <ir...@gmail.com> wrote:

> On Tuesday 04 March 2014 15:37:25 Martin Grigorov wrote:
> > Normal Panel would do it too.
> > Someone else recently asked for OpenGraph/Facebook meta headers recently
> in
> > this mailing lists. Check the archives.
>
> I found this 3D: Dynamic Headers for Open Graph tags in E-Com site
>
> I put this in my html header code:
>
> <?xml version="1.0" encoding="UTF-8"?>
> <html xmlns="http://www.w3.org/1999/xhtml" xmlns:wicket="
> http://wicket.apache.org/dtds.data/wicket-xhtml1.4-strict.dtd"
> xml:lang="it" lang="it">
> <head prefix="og: http://ogp.me/ns# fb: http://ogp.me/ns/fb#">
> <meta name="robots" content="index,follow">
> <meta name="keywords" content="...">
> <meta name="description" content="...">
>
> <wicket:container wicket:id="openGraph"></wicket:container>
>
> <title>...
>
>
> And I add this in java code:
>         ...
>         add(new Facebook("openGraph",null,null));
>         ...
>
> So, I create a new java file called Facebook.class:
>
>
> package org.apache.wicket.examples....;
> import ...;
>
> public class Facebook extends Panel implements Serializable
> {       private static final long serialVersionUID = 1L;
>
> public Facebook(String id, String query, String in)
>         {
>         super(id);
>         }
> }
>
>
> And finally I create a new file called Facebook.html:
>
>
> <?xml version="1.0" encoding="UTF-8"?>
> <html xmlns="http://www.w3.org/1999/xhtml" xmlns:wicket="
> http://wicket.apache.org/dtds.data/wicket-xhtml1.4-strict.dtd"
> xml:lang="it" lang="it">
>
> <wicket:panel>
> <meta property="fb:app_id" content="117243945141208" />
> <meta property="og:site_name" content="Test" />
> <meta property="og:type" content="website" />
> <meta property="og:title" content="Test" />
>
> <meta property="og:url" content="http://www.test.com/id=xXUjpHHfTLY" />
>
> <meta property="og:description" content="Test description" />
> <meta property="og:image" content="http://www.test.com/xXUjpHHfTLY.jpg" />
>
> </wicket:panel>
> <body>
> </body>
> </html>
>
>
> It runs ok, and if I check the source code of the rendered page it include
> meta tags:
>
> <meta name="robots" content="index,follow">
> <meta name="keywords"
> content="youtube,download,video,audio,mp3,aac,scarica,gratis">
> <meta name="description" content="Download streaming video from YouTube,
> Dailymotion and much more Scarica video gratis da YouTube">
>
> <wicket:container wicket:id="openGraph"><wicket:panel>
> <meta property="fb:app_id" content="117243945141208" />
> <meta property="og:site_name" content="Test" />
> <meta property="og:type" content="website" />
> <meta property="og:title" content="Test" />
>
> <meta property="og:url" content="http://www.test.com/id=xXUjpHHfTLY" />
>
> <meta property="og:description" content="Test description" />
> <meta property="og:image" content="http://www.test.com/xXUjpHHfTLY.jpg" />
>
> </wicket:panel></wicket:container>
>
>
> BUT IT IS STILL STATIC, HOW I CAN MODIFY IT DINAMICALLY INTO THE JAVA CODE?
> I am sorry but I am new in wicket and it results so difficult for me. In
> PHP I can do it so quickly.
>

New in Wicket: http://markmail.org/message/efxl7bgzfd3sy2ga
For 3 years experience with Wicket you should have heart of Label component
and models.
The Hello World example shows how to use Label -
http://wicket.apache.org/guide/guide/helloWorld.html#helloWorld_3
Use a Label for each <meta> and use .setVisible(false) if any of them
should be hidden when there is novalue for it.


> Thank you so much for help.
>
>
>
>
>
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

Re: How to set meta tags prroperty for facebook and Open Graph?

Posted by - <ir...@gmail.com>.
On Tuesday 04 March 2014 15:37:25 Martin Grigorov wrote:
> Normal Panel would do it too.
> Someone else recently asked for OpenGraph/Facebook meta headers recently in
> this mailing lists. Check the archives.

I found this 3D: Dynamic Headers for Open Graph tags in E-Com site

I put this in my html header code:

<?xml version="1.0" encoding="UTF-8"?>
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:wicket="http://wicket.apache.org/dtds.data/wicket-xhtml1.4-strict.dtd" xml:lang="it" lang="it">
<head prefix="og: http://ogp.me/ns# fb: http://ogp.me/ns/fb#">
<meta name="robots" content="index,follow">
<meta name="keywords" content="...">
<meta name="description" content="...">

<wicket:container wicket:id="openGraph"></wicket:container>

<title>...


And I add this in java code:
	...
	add(new Facebook("openGraph",null,null)); 
	...

So, I create a new java file called Facebook.class:


package org.apache.wicket.examples....;
import ...;

public class Facebook extends Panel implements Serializable
{	private static final long serialVersionUID = 1L;
	
public Facebook(String id, String query, String in)
	{
	super(id);	
	} 
} 


And finally I create a new file called Facebook.html:


<?xml version="1.0" encoding="UTF-8"?>
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:wicket="http://wicket.apache.org/dtds.data/wicket-xhtml1.4-strict.dtd" xml:lang="it" lang="it">

<wicket:panel>
<meta property="fb:app_id" content="117243945141208" />
<meta property="og:site_name" content="Test" />
<meta property="og:type" content="website" />
<meta property="og:title" content="Test" />

<meta property="og:url" content="http://www.test.com/id=xXUjpHHfTLY" />

<meta property="og:description" content="Test description" />
<meta property="og:image" content="http://www.test.com/xXUjpHHfTLY.jpg" />

</wicket:panel>
<body>
</body>
</html>


It runs ok, and if I check the source code of the rendered page it include meta tags:

<meta name="robots" content="index,follow">
<meta name="keywords" content="youtube,download,video,audio,mp3,aac,scarica,gratis">
<meta name="description" content="Download streaming video from YouTube, Dailymotion and much more Scarica video gratis da YouTube">

<wicket:container wicket:id="openGraph"><wicket:panel>
<meta property="fb:app_id" content="117243945141208" />
<meta property="og:site_name" content="Test" />
<meta property="og:type" content="website" />
<meta property="og:title" content="Test" />

<meta property="og:url" content="http://www.test.com/id=xXUjpHHfTLY" />

<meta property="og:description" content="Test description" />
<meta property="og:image" content="http://www.test.com/xXUjpHHfTLY.jpg" />

</wicket:panel></wicket:container>


BUT IT IS STILL STATIC, HOW I CAN MODIFY IT DINAMICALLY INTO THE JAVA CODE?
I am sorry but I am new in wicket and it results so difficult for me. In PHP I can do it so quickly.
Thank you so much for help.









---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: How to set meta tags prroperty for facebook and Open Graph?

Posted by Martin Grigorov <mg...@apache.org>.
Normal Panel would do it too.
Someone else recently asked for OpenGraph/Facebook meta headers recently in
this mailing lists. Check the archives.


On Tue, Mar 4, 2014 at 3:34 PM, Andrea Del Bene <an...@gmail.com>wrote:

> Hi,
>
> use a custom StringHeaderItem and add it into renderHead. I recently
> implemented such a header item that can be useful for this purpose:
>
> public class MetaTagHeaderItem extends StringHeaderItem {
>
>     public MetaTagHeaderItem(CharSequence string) {
>         super(string);
>     }
>
>     public static StringHeaderItem forMetaTag(Map<String, IModel<String>>
> attributes) {
>         return forTag("    <meta ", attributes);
>     }
>
>     public static StringHeaderItem forTag(String tag, Map<String,
> IModel<String>> attributes) {
>         return forString(tag + generateAttributes(attributes) + "/>\n");
>     }
>
>     public static String generateAttributes(Map<String, IModel<String>>
> attributes) {
>         StringBuffer sb = new StringBuffer();
>
>         for (Entry<String, IModel<String>> model : attributes.entrySet()) {
>             String modelValue = model.getValue().getObject();
>
>             // generate 'attributeName="attributeValue" ' (without single
> quotes)
>             if (!Strings.isEmpty(modelValue)) {
> sb.append(model.getKey()).append("=\"").append(
> JavaScriptUtils.escapeQuotes(modelValue)).append("\" ");
>             }
>         }
>
>         return sb.toString();
>
>     }
>
> }
>
>> I need to set meta tag property as I want for facebook and OpenGraph with
>> wicket.
>>
>> <meta property="fb:app_id" content="117243945141208" />
>> <meta property="og:site_name" content="site.com" />
>> <meta property="og:type" content="website" />
>> <meta property="og:title" content="title variable" />
>> <meta property="og:url" content="http://www.site.com/......" />
>> <meta property="og:description" content="Description variable" />
>> <meta property="og:image" content="http://www.site.com/images/...." />
>>
>> An example code is welcomed because I am a newbie. Thanks.
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>> For additional commands, e-mail: users-help@wicket.apache.org
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

Re: How to set meta tags prroperty for facebook and Open Graph?

Posted by Andrea Del Bene <an...@gmail.com>.
Hi,

use a custom StringHeaderItem and add it into renderHead. I recently 
implemented such a header item that can be useful for this purpose:

public class MetaTagHeaderItem extends StringHeaderItem {

     public MetaTagHeaderItem(CharSequence string) {
         super(string);
     }

     public static StringHeaderItem forMetaTag(Map<String, 
IModel<String>> attributes) {
         return forTag("    <meta ", attributes);
     }

     public static StringHeaderItem forTag(String tag, Map<String, 
IModel<String>> attributes) {
         return forString(tag + generateAttributes(attributes) + "/>\n");
     }

     public static String generateAttributes(Map<String, IModel<String>> 
attributes) {
         StringBuffer sb = new StringBuffer();

         for (Entry<String, IModel<String>> model : attributes.entrySet()) {
             String modelValue = model.getValue().getObject();

             // generate 'attributeName="attributeValue" ' (without 
single quotes)
             if (!Strings.isEmpty(modelValue)) {
sb.append(model.getKey()).append("=\"").append(JavaScriptUtils.escapeQuotes(modelValue)).append("\" 
");
             }
         }

         return sb.toString();
     }

}
> I need to set meta tag property as I want for facebook and OpenGraph with wicket.
>
> <meta property="fb:app_id" content="117243945141208" />
> <meta property="og:site_name" content="site.com" />
> <meta property="og:type" content="website" />
> <meta property="og:title" content="title variable" />
> <meta property="og:url" content="http://www.site.com/......" />
> <meta property="og:description" content="Description variable" />
> <meta property="og:image" content="http://www.site.com/images/...." />
>
> An example code is welcomed because I am a newbie. Thanks.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


RE: How to set meta tags prroperty for facebook and Open Graph?

Posted by Stijn de Witt <St...@planonsoftware.com>.
> Sorry, I am newbe but not so stupid!

Sorry here, I never tried to imply that.

-Stijn


-----Original Message-----
From: - [mailto:irresistiblecam@gmail.com] 
Sent: dinsdag 4 maart 2014 1:19
To: users@wicket.apache.org
Subject: Re: How to set meta tags prroperty for facebook and Open Graph?

On Monday 03 March 2014 10:05:55 Stijn de Witt wrote:
> Have a look at the .html file corresponding to your Page class. You should be able to just add it there.

Sorry, I am newbe but not so stupid!
I did it, my html file already have meta tags for facebook, but i want change content in the correspond page class.
I want use wicket to make dinamic page, not simple static html pages.
For examples now I have a link to og:image that is always the same, but I want change it dinamically.
It is similar to tag <title> in the header, you can set it in the html as static, of manage it with wicket dinamically as in this example:

html page:
....
   <head>
        <title wicket:id="pageTitle">Login Page</title>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
        <meta name="viewport" content="width=device-width" />
    </head>
.....
java class page:

 @Override 
    protected void onInitialize() { 
        super.onInitialize(); 
        Label pageTitle = new Label("pageTitle", "Login Page"); 
        this.add(pageTitle);
    } 

I didn't test it, I just read it on http://apache-wicket.1842946.n4.nabble.com/How-to-set-the-page-title-td4662372.html

 

> -Stijn
> 
> 
> -----Original Message-----
> From: - [mailto:irresistiblecam@gmail.com]
> Sent: zondag 2 maart 2014 16:01
> To: users@wicket.apache.org
> Subject: How to set meta tags prroperty for facebook and Open Graph?
> 
> I need to set meta tag property as I want for facebook and OpenGraph with wicket.
> 
> <meta property="fb:app_id" content="117243945141208" />  <meta 
>property="og:site_name" content="site.com" /> <meta property="og:type" 
>content="website" /> <meta property="og:title" content="title variable" 
>/> <meta property="og:url" content="http://www.site.com/......" />  
><meta property="og:description" content="Description variable" /> <meta 
>property="og:image" content="http://www.site.com/images/...." />
> 
> An example code is welcomed because I am a newbie. Thanks.
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: How to set meta tags prroperty for facebook and Open Graph?

Posted by Shengche Hsiao <sh...@gmail.com>.
Hello

Check official user guide page 121!

http://wicket.apache.org/guide/guide/single.pdf


On Tue, Mar 4, 2014 at 8:19 AM, - <ir...@gmail.com> wrote:

> On Monday 03 March 2014 10:05:55 Stijn de Witt wrote:
> > Have a look at the .html file corresponding to your Page class. You
> should be able to just add it there.
>
> Sorry, I am newbe but not so stupid!
> I did it, my html file already have meta tags for facebook, but i want
> change content in the correspond page class.
> I want use wicket to make dinamic page, not simple static html pages.
> For examples now I have a link to og:image that is always the same, but I
> want change it dinamically.
> It is similar to tag <title> in the header, you can set it in the html as
> static, of manage it with wicket dinamically
> as in this example:
>
> html page:
> ....
>    <head>
>         <title wicket:id="pageTitle">Login Page</title>
>         <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"
> />
>         <meta name="viewport" content="width=device-width" />
>     </head>
> .....
> java class page:
>
>  @Override
>     protected void onInitialize() {
>         super.onInitialize();
>         Label pageTitle = new Label("pageTitle", "Login Page");
>         this.add(pageTitle);
>     }
>
> I didn't test it, I just read it on
> http://apache-wicket.1842946.n4.nabble.com/How-to-set-the-page-title-td4662372.html
>
>
>
> > -Stijn
> >
> >
> > -----Original Message-----
> > From: - [mailto:irresistiblecam@gmail.com]
> > Sent: zondag 2 maart 2014 16:01
> > To: users@wicket.apache.org
> > Subject: How to set meta tags prroperty for facebook and Open Graph?
> >
> > I need to set meta tag property as I want for facebook and OpenGraph
> with wicket.
> >
> > <meta property="fb:app_id" content="117243945141208" />
> > <meta property="og:site_name" content="site.com" />
> ><meta property="og:type" content="website" />
> ><meta property="og:title" content="title variable" />
> ><meta property="og:url" content="http://www.site.com/......" />
> > <meta property="og:description" content="Description variable" />
> ><meta property="og:image" content="http://www.site.com/images/...." />
> >
> > An example code is welcomed because I am a newbie. Thanks.
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> > For additional commands, e-mail: users-help@wicket.apache.org
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> > For additional commands, e-mail: users-help@wicket.apache.org
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>


-- 

----------------------------------------------------------------------->
We do this not because it is easy. We do this because it is hard.
----------------------------------------------------------------------->
ShengChe Hsiao
----------------------------------------------------------------------->
front713@gmail.com
front713@tc.edu.tw
----------------------------------------------------------------------->
VoIP : 070-910-2450
----------------------------------------------------------------------->

Re: How to set meta tags prroperty for facebook and Open Graph?

Posted by - <ir...@gmail.com>.
On Monday 03 March 2014 10:05:55 Stijn de Witt wrote:
> Have a look at the .html file corresponding to your Page class. You should be able to just add it there.

Sorry, I am newbe but not so stupid!
I did it, my html file already have meta tags for facebook, but i want change content in the correspond page class.
I want use wicket to make dinamic page, not simple static html pages.
For examples now I have a link to og:image that is always the same, but I want change it dinamically.
It is similar to tag <title> in the header, you can set it in the html as static, of manage it with wicket dinamically
as in this example:

html page:
....
   <head>
        <title wicket:id="pageTitle">Login Page</title>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
        <meta name="viewport" content="width=device-width" />
    </head>
.....
java class page:

 @Override 
    protected void onInitialize() { 
        super.onInitialize(); 
        Label pageTitle = new Label("pageTitle", "Login Page"); 
        this.add(pageTitle);
    } 

I didn't test it, I just read it on http://apache-wicket.1842946.n4.nabble.com/How-to-set-the-page-title-td4662372.html

 

> -Stijn
> 
> 
> -----Original Message-----
> From: - [mailto:irresistiblecam@gmail.com] 
> Sent: zondag 2 maart 2014 16:01
> To: users@wicket.apache.org
> Subject: How to set meta tags prroperty for facebook and Open Graph?
> 
> I need to set meta tag property as I want for facebook and OpenGraph with wicket.
> 
> <meta property="fb:app_id" content="117243945141208" />
> <meta property="og:site_name" content="site.com" /> 
><meta property="og:type" content="website" /> 
><meta property="og:title" content="title variable" />
><meta property="og:url" content="http://www.site.com/......" />
> <meta property="og:description" content="Description variable" /> 
><meta property="og:image" content="http://www.site.com/images/...." />
> 
> An example code is welcomed because I am a newbie. Thanks.
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


RE: How to set meta tags prroperty for facebook and Open Graph?

Posted by Stijn de Witt <St...@planonsoftware.com>.
Have a look at the .html file corresponding to your Page class. You should be able to just add it there.

-Stijn


-----Original Message-----
From: - [mailto:irresistiblecam@gmail.com] 
Sent: zondag 2 maart 2014 16:01
To: users@wicket.apache.org
Subject: How to set meta tags prroperty for facebook and Open Graph?

I need to set meta tag property as I want for facebook and OpenGraph with wicket.

<meta property="fb:app_id" content="117243945141208" /> <meta property="og:site_name" content="site.com" /> <meta property="og:type" content="website" /> <meta property="og:title" content="title variable" /> <meta property="og:url" content="http://www.site.com/......" /> <meta property="og:description" content="Description variable" /> <meta property="og:image" content="http://www.site.com/images/...." />

An example code is welcomed because I am a newbie. Thanks.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org