Announcement

#1 2012-07-15 14:19:38

geoffschultz
Member
Marlborough, MA, USA
2012-07-01
148

[resolved] How to use plugin "Add <head> Element"?

I want to add information to the <head> section of image pages.  For example, in my current (non-piwigo) web site, I output information like:

<meta name="geo.position" content="-112.093667; 27.188833"/>
<meta name="geo.region" content="MEX-BCS"/>
<meta name="geo.placename" content="Isla San Marcos, BCS, Mexico"/>
<meta name="keywords" content="BCS, Isla San Marcos, MEX, Mexico"/>
<meta name="description" content="Gypsum Mine, Mexico, BCS, Isla San Marcos, MEX, "/>

This is generated from IPTC fields.  I have both Advanced Metadata and Add <head> Element installed, but I have no idea how to use these to generate code like what is displayed above.

Any help/examples would be appreciated.  I'm running 2.4.1

-- Geoff

Last edited by geoffschultz (2012-07-15 14:21:25)

Offline

 

#2 2012-07-16 13:40:59

geoffschultz
Member
Marlborough, MA, USA
2012-07-01
148

Re: [resolved] How to use plugin "Add <head> Element"?

From what I can see, this plugin simply outputs the text within the text box and that you can't imbed any PHP code.  Is that correct? 

-- Geoff

Last edited by geoffschultz (2012-07-16 13:41:21)

Offline

 

#3 2012-07-16 13:43:47

ddtddt
Piwigo Team
Quetigny - France
2007-07-27
6753

Re: [resolved] How to use plugin "Add <head> Element"?

geoffschultz wrote:

From what I can see, this plugin simply outputs the text within the text box and that you can't imbed any PHP code.  Is that correct? 

-- Geoff

yes


You love Piwigo so don't hesitate to participate, learn more on the "Contribute to Piwigo" page. If you don't have much time for contribution, you can also help the project with a donation.

Online

 

#4 2012-07-16 13:44:39

ddtddt
Piwigo Team
Quetigny - France
2007-07-27
6753

Re: [resolved] How to use plugin "Add <head> Element"?

for use this plugin paste only

<meta name="geo.position" content="-112.093667; 27.188833"/>
<meta name="geo.region" content="MEX-BCS"/>
<meta name="geo.placename" content="Isla San Marcos, BCS, Mexico"/>
<meta name="keywords" content="BCS, Isla San Marcos, MEX, Mexico"/>
<meta name="description" content="Gypsum Mine, Mexico, BCS, Isla San Marcos, MEX, "/>

in the admin part and it's ok


You love Piwigo so don't hesitate to participate, learn more on the "Contribute to Piwigo" page. If you don't have much time for contribution, you can also help the project with a donation.

Online

 

#5 2012-07-16 14:18:11

geoffschultz
Member
Marlborough, MA, USA
2012-07-01
148

Re: [resolved] How to use plugin "Add <head> Element"?

I need to generate these <meta> fields using IPTC data.  Is there anyway to do this?

-- Geoff

Offline

 

#6 2012-07-24 19:03:37

ddtddt
Piwigo Team
Quetigny - France
2007-07-27
6753

Re: [resolved] How to use plugin "Add <head> Element"?

geoffschultz wrote:

I need to generate these <meta> fields using IPTC data.  Is there anyway to do this?

-- Geoff

The IPTC are in database ?


You love Piwigo so don't hesitate to participate, learn more on the "Contribute to Piwigo" page. If you don't have much time for contribution, you can also help the project with a donation.

Online

 

#7 2012-07-24 19:14:25

geoffschultz
Member
Marlborough, MA, USA
2012-07-01
148

Re: [resolved] How to use plugin "Add <head> Element"?

ddtddt wrote:

geoffschultz wrote:

I need to generate these <meta> fields using IPTC data.  Is there anyway to do this?

-- Geoff

The IPTC are in database ?

No, but they're being pulled out by Advanced Metadata.

Offline

 

#8 2012-07-24 19:48:41

ddtddt
Piwigo Team
Quetigny - France
2007-07-27
6753

Re: [resolved] How to use plugin "Add <head> Element"?

geoffschultz wrote:

ddtddt wrote:

geoffschultz wrote:

I need to generate these <meta> fields using IPTC data.  Is there anyway to do this?

-- Geoff

The IPTC are in database ?

No, but they're being pulled out by Advanced Metadata.

Advanced Metadata add IPTC in database ? no ?


You love Piwigo so don't hesitate to participate, learn more on the "Contribute to Piwigo" page. If you don't have much time for contribution, you can also help the project with a donation.

Online

 

#9 2012-07-24 20:01:45

geoffschultz
Member
Marlborough, MA, USA
2012-07-01
148

Re: [resolved] How to use plugin "Add <head> Element"?

I would have thought so, but when I look at the amd_* tables, I don't see any data stored in the database.  I'm quite surprised & don't know how it works.

-- Geoff

Offline

 

#10 2012-07-24 20:48:52

ddtddt
Piwigo Team
Quetigny - France
2007-07-27
6753

Re: [resolved] How to use plugin "Add <head> Element"?

geoffschultz wrote:

I would have thought so, but when I look at the amd_* tables, I don't see any data stored in the database.  I'm quite surprised & don't know how it works.

-- Geoff

I notifie grum


You love Piwigo so don't hesitate to participate, learn more on the "Contribute to Piwigo" page. If you don't have much time for contribution, you can also help the project with a donation.

Online

 

#11 2012-07-25 22:50:16

grum
Piwigo Team
Nantes
2007-09-10
1371

Re: [resolved] How to use plugin "Add <head> Element"?

AMD provide some function that you can use in a personnal plugin, and it might be possible to do what you want but I have to take a look to see how to do it. I'll try to give an answer this we.


My pictures with Piwigo, of course !
[ www.grum.fr ] [ photos.grum.fr ]

Offline

 

#12 2012-07-25 23:51:49

rvelices
Piwigo Team
2005-12-29
1960

Re: [resolved] How to use plugin "Add <head> Element"?

the geo.position meta tag is automatically added by rv map & earth
for example:

Code:

<meta name=geo.position content=41.350367;-72.405239>

here: http://www.geoffschultz.org/photos/pict … y/essex_ct

Offline

 

#13 2012-07-26 00:05:00

geoffschultz
Member
Marlborough, MA, USA
2012-07-01
148

Re: [resolved] How to use plugin "Add <head> Element"?

I also generate the following elements:

Code:

<meta name="geo.region" content="MEX-BCS"/>
<meta name="geo.placename" content="Isla San Marcos, BCS, Mexico"/>

The comes from the

CountryCode: 2#100
ProvinceState: 2#95
CountryName: 2#101
City: 2#90

-- Geoff

Last edited by geoffschultz (2012-07-26 12:23:15)

Offline

 

#14 2012-07-26 18:39:49

grum
Piwigo Team
Nantes
2007-09-10
1371

Re: [resolved] How to use plugin "Add <head> Element"?

Assuming you have AdvancedMetaData installed.

With LocalFileEditor, go on the personnal plugin tab.

Put this:

Code:

<?php
// call function when metadata are loaded (triggered on the picture page only)
add_event_handler('amd_jpegMD_loaded', 'metaDataLoaded');

// add <meta> to header with metadata from picture
function metaDataLoaded($jpegMD)
{
  global $template;
 
  $null=null;
  
  $nfo=$jpegMD->getTag('magic.GPS.LatitudeNum')->getValue().';'.$jpegMD->getTag('magic.GPS.LongitudeNum')->getValue();  
  $template->block_html_head(null, "<meta name='geo.position' content='$nfo'>", $null, $null);
}
?>

Don't forget to activate the personnal plugin.

The example provides you the code to add geolocalisation from magic metadata, there's now no difficulties to add another info.


You'll found the complete list of known identifier in the metadata tab of the plugin (and if any question about the plugin, please open a dedicated topiv)


My pictures with Piwigo, of course !
[ www.grum.fr ] [ photos.grum.fr ]

Offline

 

#15 2012-07-26 19:52:21

geoffschultz
Member
Marlborough, MA, USA
2012-07-01
148

Re: [resolved] How to use plugin "Add <head> Element"?

grum,

Thanks so very much for the reply.  That's exactly what I was looking for!

-- Geoff

Offline

 

Board footer

Powered by FluxBB

github twitter facebook google+ newsletter Donate Piwigo.org © 2002-2019 · Contact