How do I print a specific meta tag attribute value in html.tpl.php? I am trying to create WebSite schema condition output in html.tpl.php in Drupal 7, so installed schema.org module, but it doesn't come with all the fields that my project required, for example, description. How do I get the description value from &quot;admin/config/search/metatags/config/global%3Afrontpage&quot;?
What I have so far.
&lt;?php if(drupal_is_front_page()) {
$logoSchema = theme_get_setting('logo');
$urlSchema = $GLOBALS['base_url'];
echo '
&lt;script type=&quot;application/ld+json&quot;&gt;
{
  &quot;@context&quot;: &quot;http://schema.org&quot;,
  &quot;@type&quot;: &quot;WebSite&quot;,
  &quot;url&quot;: &quot;'. $urlSchema .'&quot;,
  &quot;name&quot;: &quot;Company Name, Inc.&quot;,
  &quot;image&quot;: &quot;'. $logoSchema .'&quot;,
  &quot;description&quot;: &quot;**NEED HELP GETTING THE VALUE**&quot;,
  &quot;potentialAction&quot;: {
    &quot;@type&quot;: &quot;SearchAction&quot;,
    &quot;target&quot;: &quot;'. $urlSchema .'/search/{search_term_string}&quot;,
    &quot;query-input&quot;: &quot;required name=search_term_string&quot;
  }
}
&lt;/script&gt;';
} ?&gt;
&lt;/head&gt;
create a preprocess_html function in template.php
function porto_sub_preprocess_html(&amp;$vars){
  if (drupal_is_front_page()) {
    if (isset($vars['page']) &amp;&amp; isset($vars['page']['content']) &amp;&amp; isset($vars['page']['content']['metatags'])) {
      $meta_tags = $vars['page']['content']['metatags'];
      if (isset($meta_tags['global:frontpage']) &amp;&amp; isset($meta_tags['global:frontpage']['description'])) {
        $meta_desc_list = $meta_tags['global:frontpage']['description'];
        if (isset($meta_desc_list['#attached']) &amp;&amp; isset($meta_desc_list['#attached']['drupal_add_html_head'])) {
          if (isset($meta_desc_list['#attached']['drupal_add_html_head'][0]) &amp;&amp; isset($meta_desc_list['#attached']['drupal_add_html_head'][0][0])) {
            if ($meta_desc_list['#attached']['drupal_add_html_head'][0][0]['#value']) {
              $vars['front_page_meta_desc'] = $meta_desc_list['#attached']['drupal_add_html_head'][0][0]['#value'];
            }
          }
        }
      }
    }
  }
  drupal_add_http_header('Cache-Tag','mktg',true);



 
2. This defined meta tag is accessible from html.tpl.php
 if (!isset($front_page_meta_desc)) {
       $front_page_meta_desc = '';
     }

In the schema JSONLD, you need to call the variable.
&quot;description&quot;: &quot;' . $front_page_meta_desc . '&quot;,