Developer forum

Forum » CMS - Standard features » moving body content to head OnLoad - Having trouble gettting facebook share to show correct image

moving body content to head OnLoad - Having trouble gettting facebook share to show correct image

Hans Ravnsfjall
Reply

Hi

 

I am having trouble getting a facebook share function to show the correct image. Reason being the image url is inside body, and the facebook tag for image has to be in head to work.

 

The head section is obviously in the page template, but the image is in a show news (NewsV2) template.

 

I have tried with jquery/javascript, but that doesn´t seem to work either.

So my question is, is it possible to move content from body to head OnLoad in a normal html template?

 

Has anyone fixed this in some other way?

 

 


Replies

 
Morten Bengtson
Reply
This post has been marked as an answer

You can use snippets to move content from one template to another at render time.

Here is an example.

Votes for this answer: 1
 
Kenneth Radoor
Reply

And as a rule of thumb, it is no good using script to get content to a bot, as they do not execute script. only read of static content.

 

You must be logged in to post in the forum