Announcement

  •  » Requests
  •  » og:image meta tag in header for picture page

#1 2014-10-21 10:21:29

matthys
Member
2014-04-02
135

og:image meta tag in header for picture page

Hi there,

I know this has been asked before but I would like to have the following meta tag in the header of the picture page:
<meta property="og:image" content="(full_picture_upload_path)">

What I have done is modified the header.tpl and added this just before the title:
{if isset($U_ORIGINAL)}
<meta property="og:image" content="(full_url_website)/{$U_ORIGINAL}">
{/if}

This will result in something like this in the picture page:
<meta property="og:image" content="http://www.vanwageningen.net/../../../upload/2014/10/08/20141008141052-3664d48a.jpg">

This seems to work fine but rather would like to strip the "../../../" part from the $U_ORIGINAL.
But this can not be done in the template itself. Or is there any other variable to use i.o. $U_ORIGINAL?

PS .. before you ask, no I did not modify the original header.tpl but used LocalFiles Editor and created a custom-header.tpl as I also modified other meta tags ;-)

Thanks,
Matthijs

Last edited by matthys (2014-10-21 10:25:18)

Offline

 

#2 2014-10-21 10:47:34

flop25
Piwigo Team
2006-07-06
7037

Re: og:image meta tag in header for picture page

Hi
not a specialist but I think for that you would need to build the url abslote in php, with piwigo functions, then (assign that value to template/smarty variable) or (prefilter the heder tpl to add the html)


To get a better help : Politeness like Hello-A link-Your past actions precisely described
Check my extensions : more than 30 available
who I am and what I do : http://fr.gravatar.com/flop25
My gallery : an illustration of how to integrate Piwigo in your website

Offline

 

#3 2014-10-21 11:23:21

matthys
Member
2014-04-02
135

Re: og:image meta tag in header for picture page

Thanks

Or would this be a good idea to place it in a "Personal Plugin" (also available under LocalFiles Editor)?

Last edited by matthys (2014-10-21 11:23:46)

Offline

 

#4 2014-10-21 11:54:15

flop25
Piwigo Team
2006-07-06
7037

Re: og:image meta tag in header for picture page

yes Or your custom theme if you have one


To get a better help : Politeness like Hello-A link-Your past actions precisely described
Check my extensions : more than 30 available
who I am and what I do : http://fr.gravatar.com/flop25
My gallery : an illustration of how to integrate Piwigo in your website

Offline

 
  •  » Requests
  •  » og:image meta tag in header for picture page

Board footer

Powered by FluxBB

github twitter newsletter Donate Piwigo.org © 2002-2022 · Contact