Hello everyone
to display images that load in the news module to use this string
and it works perfectly
<img src="{$entry->file_location}/{$entry->fieldsbyname.immagine->value}" alt="{$entry->title|cms_escape}" />
but in the template if i use this string for the og image
<meta property="og:image" content="<img src="{$entry->file_location}/{$entry->fieldsbyname.immagine->value}" />
the selected image is wrong
and there is but 'that of another news
why
thanks for help
the website is
http://www.teneriecoccolosi.it
[SOLVED] the og:image in news module is always wrong
[SOLVED] the og:image in news module is always wrong
Last edited by giapippo on Tue Oct 28, 2014 5:06 pm, edited 1 time in total.
Re: the og:image in news module is always wrong
You will probably have to post your News template.
Re: the og:image in news module is always wrong
It's not a good assumption that the $entry variable/object is persistant.
You better assign those values to your own custom smarty variables and use those in the meta tag:
Not tested. BTW the 'content="<img src="' should not be in the content attribute of the meta tag.
You better assign those values to your own custom smarty variables and use those in the meta tag:
Code: Select all
Somewhere in News template:
{$meta_filelocation=$entry->file_location}
{$meta_filename=$entry->fieldsbyname.immagine->value}
In head section:
<meta property="og:image" content="{$meta_filelocation}/{$meta_filename}" />
Re: the og:image in news module is always wrong
thanks
I do a couple of tests
but it seems to work perfectly
I do a couple of tests
but it seems to work perfectly


