wicket-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From - <irresistible...@gmail.com>
Subject Re: How to set meta tags prroperty for facebook and Open Graph?
Date Wed, 05 Mar 2014 02:15:49 GMT
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


Mime
View raw message