1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586 |
- <?php
- /**
- * Implements hook_preprocess_html().
- */
- function metatag_opengraph_preprocess_html(&$variables) {
- // Fall back to hook_rdf_namespaces if the rdf module is enabled.
- if (module_exists('rdf')) {
- return;
- }
- // @TODO Would it be worth dynamically identifying whether these should be
- // added, or just output them all?
- // Need an extra namespace for the 'og' tags.
- $variables['rdf_namespaces'] .= "\n xmlns:og=\"http://ogp.me/ns#\"";
- // Need an extra namespace for the "article" tags.
- $variables['rdf_namespaces'] .= "\n xmlns:article=\"http://ogp.me/ns/article#\"";
- // Need an extra namespace for the "book" tags.
- $variables['rdf_namespaces'] .= "\n xmlns:book=\"http://ogp.me/ns/book#\"";
- // Need an extra namespace for the "profile" tags.
- $variables['rdf_namespaces'] .= "\n xmlns:profile=\"http://ogp.me/ns/profile#\"";
- // Need an extra namespace for the "video" tags.
- $variables['rdf_namespaces'] .= "\n xmlns:video=\"http://ogp.me/ns/video#\"";
- // And for product tags.
- $variables['rdf_namespaces'] .= "\n xmlns:product=\"http://ogp.me/ns/product#\"";
- }
- /**
- * Implements hook_rdf_namespaces().
- */
- function metatag_opengraph_rdf_namespaces() {
- return array(
- 'og' => 'http://ogp.me/ns#',
- 'article' => 'http://ogp.me/ns/article#',
- 'book' => 'http://ogp.me/ns/book#',
- 'profile' => 'http://ogp.me/ns/profile#',
- 'video' => 'http://ogp.me/ns/video#',
- 'product' => 'http://ogp.me/ns/product#',
- );
- }
- /**
- * Implements hook_ctools_plugin_api().
- */
- function metatag_opengraph_ctools_plugin_api($owner, $api) {
- if ($owner == 'metatag' && $api == 'metatag') {
- return array('version' => 1);
- }
- }
- /*
- og:title = [node:title] / [user:name]
- og:type = article / profile
- og:image = ? / [user:picture:url]
- og:url = [node:url] / [user:url]
- og:description
- og:site_name = [site:name]
- og:latitude
- og:longitude
- og:street-address
- og:locality
- og:region
- og:postal-code
- og:country-name
- og:email
- og:phone_number
- og:fax_number
- og:video:url
- og:video:secure_url
- og:video:height
- og:video:width
- og:video:type
- og:audio
- og:audio:title
- og:audio:artist
- og:audio:album
- og:audio:type
- og:upc
- og:isbn
- */
|