You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Arjun Dhar <dh...@yahoo.com> on 2014/02/04 12:41:18 UTC

Dynamic Headers for Open Graph tags in E-Com site

Hi,

I have an E-Commerce site. Im using a Template hierarchy. With the top
template containing the Open Graph tags for the entire Site.

Like



The issue is there are PRODUCT PAGES that extend this template. But for
Products its desirable to insert PRODUCT SPECIFIC headers.

What is the cleanest way to do this?

Note I can do this in a Dirty Way: If I use "IHeaderContributor" in the
Product Page then it will "APPEND" it not replace the template tags. .. and
removing thsi from the base template and Providing it for each page does not
seem good either.

..Anyway I can demarkate this and override?

thanks



-----
Software documentation is like sex: when it is good, it is very, very good; and when it is bad, it is still better than nothing!
--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/Dynamic-Headers-for-Open-Graph-tags-in-E-Com-site-tp4664158.html
Sent from the Users forum mailing list archive at Nabble.com.

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


Re: Dynamic Headers for Open Graph tags in E-Com site

Posted by Arjun Dhar <dh...@yahoo.com>.
Hey thanks .... ya sorry i re-edited my post.
But helps. .. never tried using panels in Headers. It failed for me sometime
so I assumed its not the right thing ....

thanks again, will try it

-----
Software documentation is like sex: when it is good, it is very, very good; and when it is bad, it is still better than nothing!
--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/Dynamic-Headers-for-Open-Graph-tags-in-E-Com-site-tp4664158p4664181.html
Sent from the Users forum mailing list archive at Nabble.com.

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


Re: Dynamic Headers for Open Graph tags in E-Com site

Posted by Martin Grigorov <mg...@apache.org>.
My panel had all meta tags for all possible data.
Each page constructs some data (a model) depending on the current
functionality.
Then the panel uses the model to populate some of the meta tags and to set
invisible all without data for them.

Martin Grigorov
Wicket Training and Consulting


On Wed, Feb 5, 2014 at 1:17 PM, Arjun Dhar <dh...@yahoo.com> wrote:

> Thanks ..so using Panels in the <header> did work out fine. .. using
> container !
>
> Though; I want to put custom variables in the META tags; I found it more
> complex it to do via Wicket.
> Rather used Velocity to accept a MAP of Attributes and generate the META
> TAGS and pass that into a FRAGMENT seemed scalable and faster.
>
> But curious if you dumped the entire META content is a String or you used
> Some sort of Repeater or Wicket component to render the Dynamic individual
> Meta tags?
>
> Example in Velocity I found to be a breeze over wicket:
>
>
> -----
> Software documentation is like sex: when it is good, it is very, very
> good; and when it is bad, it is still better than nothing!
> --
> View this message in context:
> http://apache-wicket.1842946.n4.nabble.com/Dynamic-Headers-for-Open-Graph-tags-in-E-Com-site-tp4664158p4664194.html
> Sent from the Users forum mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

Re: Dynamic Headers for Open Graph tags in E-Com site

Posted by Arjun Dhar <dh...@yahoo.com>.
Thanks ..so using Panels in the <header> did work out fine. .. using
container !

Though; I want to put custom variables in the META tags; I found it more
complex it to do via Wicket.
Rather used Velocity to accept a MAP of Attributes and generate the META
TAGS and pass that into a FRAGMENT seemed scalable and faster.

But curious if you dumped the entire META content is a String or you used
Some sort of Repeater or Wicket component to render the Dynamic individual
Meta tags?

Example in Velocity I found to be a breeze over wicket:


-----
Software documentation is like sex: when it is good, it is very, very good; and when it is bad, it is still better than nothing!
--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/Dynamic-Headers-for-Open-Graph-tags-in-E-Com-site-tp4664158p4664194.html
Sent from the Users forum mailing list archive at Nabble.com.

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


Re: Dynamic Headers for Open Graph tags in E-Com site

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


On Wed, Feb 5, 2014 at 8:28 AM, Arjun Dhar <dh...@yahoo.com> wrote:

> I think I'll take a simple approach.
>
> Use a Spring Resource to read a file which contains only the OG Tags and
> use
> EhCache to cache the content.
> I'll remove the OG Tags from the Common Template and instead inject it
> dynamically then
>
> For product pages the OG tags have to be created per request so override
> the
> header contribution for this part and insert the Product Specific OG Tags.
>
> Like we have Panels in the Body section, why cant we have a concept like
> that for the Header?
>

This is exactly how I did it once - use a normal Panel in the header
section:
<head>
  ...
  <wicket:container wicket:id="openGraph"></wicket:container>
  ...
  </head>

And then a base Page has a method that adds the panel if the current page
constructs non-empty model.
Simple.


> Anyway
>
> -----
> Software documentation is like sex: when it is good, it is very, very
> good; and when it is bad, it is still better than nothing!
> --
> View this message in context:
> http://apache-wicket.1842946.n4.nabble.com/Dynamic-Headers-for-Open-Graph-tags-in-E-Com-site-tp4664158p4664172.html
> Sent from the Users forum mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

Re: Dynamic Headers for Open Graph tags in E-Com site

Posted by Arjun Dhar <dh...@yahoo.com>.
I think I'll take a simple approach.

Use a Spring Resource to read a file which contains only the OG Tags and use
EhCache to cache the content.
I'll remove the OG Tags from the Common Template and instead inject it
dynamically then

For product pages the OG tags have to be created per request so override the
header contribution for this part and insert the Product Specific OG Tags.

Like we have Panels in the Body section, why cant we have a concept like
that for the Header?
Anyway

-----
Software documentation is like sex: when it is good, it is very, very good; and when it is bad, it is still better than nothing!
--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/Dynamic-Headers-for-Open-Graph-tags-in-E-Com-site-tp4664158p4664172.html
Sent from the Users forum mailing list archive at Nabble.com.

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