How to add single image url to head for OG etc. meta tags

In head I have some OG meta tags. How I get url for single image view in to it? Now when I share image it does not show image viewed.

<meta property="og:image" content="[what call to show single image url]" />

Call the mgGetImages snippet with a limit of 1, and an &imageTpl that renders the meta tag. That fetches the first image in the gallery.

If you mean the actual “single image view” (with the iid parameter in the link), you can also call mgGetImages again to fill your meta tag, but you’ll need to use the same &singleImage* parameters as your main call.

Ok. Tried this kind of:
<meta property="og:image" content="[[!++site_url]][[!mgGetImages? &singleImageTpl=mg-metatag]]" />
and
<meta property="og:image" content="[[!++site_url]][[!mgGetImages? &limit=1&imageTpl=mg-metatag&singleImageTpl=mg-metatag]]" />

where mg-metatag chunk is just [[+view_url]].
First works for singleimage but renders all album images at top of page in album view.
Second works in album view but not in single view while it renders correct url like (FB debugger Scraping didn`t help):

     <meta property="og:image" content="https://www.photorgasm.com/
    pimio/leena.html?kuva=739" />

And both calls render metatag in two lines like in example.
We are close but but something I`ve done wrong.

You’d probably need the second one, which sets both chunk templates regardless of wether it’s viewing all or a single image.

Try using [[+file_url]] instead of [[+view_url]] to make sure it points to the image rather than the view link?

Not working! Url is correct but not showing image when shared. And why it outputs meta tag in two lines like:

<meta property="og:image" content="https://www.photorgasm.com/
/assets/tiedostot/valokuvat/galleria/leena/vs-leenaimg-7177-739.jpg" />

Maybe this meta tag needs something too, it points to album page:

<meta property="og:url" content="https://www.photorgasm.com/pimio/leena.html" />

That url in two line solved. My bad as allways, static chunk with modx comment cause that!

Made two chunks for properties for future usage :wink:
mg-metatag-file-url for file url and mg-metatag-view-url for view url.

Metadata line is now:
<meta property="og:image" content="[[!++site_url]][[!mgGetImages? &limit=1&imageTpl=mg-metatag-file-url&singleImageTpl=mg-metatag-file-url]]" />

Seems ok BUT Double slash in url after domain! Where that comes? Configuration? Checked resource settings, mg system settings and media source urls, none have slash in begin of url settings.

<meta property="og:image" content="https://www.photorgasm.com//assets/tiedostot/valokuvat/galleria/asbraktia/vs_asbraktia_MG_3983_863.jpg" />

Then I made this for url metadata:

<meta property="og:url" content="[[!++site_url]][[!mgGetImages? &limit=`1` &imageTpl=`mg-metatag-view-url` &singleImageTpl=`mg-metatag-view-url`]]" />

and url is without double slash!!

<meta property="og:url" content="https://www.photorgasm.com/pimio/asbraktia.html?kuva=863" />

Also sharing seems much better now! Only that in single view shared image is allways same (album start image).

I tried also with two separate calls like this:

<meta property="og:image" content="[[!++site_url]][[!mgGetImages? &limit=`1` &imageTpl=`mg-metatag-file-url`]][[!mgGetImages? &singleImageTpl=`mg-metatag-file-url`]]" />

This outputs like off canvas, all output is viewable?
Album view:

<meta property="og:url" content="https://www.photorgasm.com/pimio/asbraktia.html?kuva=863 <li class="mg-image"> <a href="[pimio/asbraktia.html?kuva=863](view-source:https://www.photorgasm.com/pimio/asbraktia.html?kuva=863)" title="Viisas vanha kosmos"> <img src="[/assets/tiedostot/valokuvat/galleria/asbraktia/_thumbs/863_f8ba3ca91c13dda96808f91f0a7e9387.jpg](view-source:https://www.photorgasm.com/assets/tiedostot/valokuvat/galleria/asbraktia/_thumbs/863_f8ba3ca91c13dda96808f91f0a7e9387.jpg)" alt="Viisas vanha kosmos"> </a> </li> <li class="mg-image"> <a href="[pimio/asbraktia.html?kuva=864](view-source:https://www.photorgasm.com/pimio/asbraktia.html?kuva=864)" etc...

and in singel view output:

<meta property="og:url" content="https://www.photorgasm.com/<p> <a href="/assets/tiedostot/valokuvat/galleria/asbraktia/vs_asbraktia_MG_3983_863.jpg"> <img src="[/assets/tiedostot/valokuvat/galleria/asbraktia/vs_asbraktia_MG_3983_863.jpg](view-source:https://www.photorgasm.com/assets/tiedostot/valokuvat/galleria/asbraktia/vs_asbraktia_MG_3983_863.jpg)" class="img-polaroid" alt="Viisas vanha kosmos"> </a> </p> <p> <span class="text-center center">Viisas vanha kosmos</span> <a href="[pimio/asbraktia.html?kuva=864](view-source:https://www.photorgasm.com/pimio/asbraktia.html?kuva=864)" class="text-right right">Tutticus Plasticus &raquo;</a> </p> pimio/asbraktia.html?kuva=863" />

This is so far near right but why it renders default singleImageTpl and imageTpl in it?