In the news module, I created a field module for the user to assign an image to a news item. In my summary and detail template, this is how I call it:
Code: Select all
{if !empty($entry->summaryimage)}
<img src="{$entry->file_location}/{$entry->summaryimage}" alt="" />
{else}
<img src="uploads/images/news-default-image.gif" alt=""/>
{/if}
Code: Select all
{if !empty($entry->summaryimage)}
<meta property="og:image" content="{root_url}/{$entry->summaryimage}" />
{/if}
Reason I am calling that image on my template, is so that image can be added to the facebook META data, and that image will be picked up if a user shares that page. The Facebook META data has to sit in the HEAD of the page, not in the BODY of the page.
Thanks for any help!
Joe C.