Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6931259
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T11:33:14+00:00 2026-05-27T11:33:14+00:00

How do I use the Codeigniter Metatag helper with the Facebook open graph metatags?

  • 0

How do I use the Codeigniter Metatag helper with the Facebook open graph metatags?

the metatag helper wants to inject name as the first attribute which Facebook doesn’t use. Is there any way to use the helper to add my own custom scheme? It seems there are some defaults like 'name' that i can’t get rid of using the helper.

what i did:

$meta = array(
        array('property' => 'og:type', 'content' => 'movie'),
        array('property' => 'og:video:height', 'content' => '260'),
        array('property' => 'og:video:width', 'content' => '420'),
        array('property' => 'og:video:type', 'content' => 'application/x-shockwave-flash'),
        array('property' => 'og:title', 'content' => $data['video']),
        array('property' => 'og:description', 'content' => $data['video_desc']),
        array('property' => 'og:image', 'content' => 'http://i2.ytimg.com/vi/'.$data['links']['extra_link_info']['original_key'].'/hqdefault.jpg'),
        array('property' => 'og:video', 'content' => 'https://www.youtube.com/v/'.$data['links']['extra_link_info']['original_key'].'?version=3&autohide=1&autoplay=1')
        );

what i get:

<meta name="" content="movie" />

<meta name="" content="260" />

<meta name="" content="420" />

<meta name="" content="application/x-shockwave-flash" />

<meta name="" content="xxxxxxxx" />

<meta name="" content="xxxxxxxx" />

<meta name="" content="http://i2.ytimg.com/vi/xxxxxxxx/hqdefault.jpg" />

<meta name="" content="xxxxxxxx" />

what i want:

<meta property="og:tyoe" content="movie" />

<meta property="og:video:height" content="260" />

<meta property="og:video:width" content="420" />

<meta property="og:video:type" content="application/x-shockwave-flash" />

<meta property="og:title" content="xxxxxxxx" />

<meta property="og:description" content="xxxxxxxx" />

<meta property="og:image" content="http://i2.ytimg.com/vi/xxxxxxxx/hqdefault.jpg" />

<meta property="og:video" content="xxxxxxxx" />
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T11:33:14+00:00Added an answer on May 27, 2026 at 11:33 am

    Fixed it:

    Extended the HTML helper and changed all the name references to property.

    MY_html_helper

    <?php
    
    /**
     * Generates meta tags from an array of key/values
     *
     * @access  public
     * @param   array
     * @return  string
     */
    if ( ! function_exists('meta'))
    {
        function meta($property = '', $content = '', $type = 'property', $newline = "\n")
        {
            // Since we allow the data to be passes as a string, a simple array
            // or a multidimensional one, we need to do a little prepping.
            if ( ! is_array($property))
            {
                $property = array(array('property' => $property, 'content' => $content, 'type' => $type, 'newline' => $newline));
            }
            else
            {
                // Turn single array into multidimensional
                if (isset($property['property']))
                {
                    $property = array($property);
                }
            }
    
            $str = '';
            foreach ($property as $meta)
            {
                $type       = ( ! isset($meta['type']) OR $meta['type'] == 'property') ? 'property' : 'http-equiv';
                $property       = ( ! isset($meta['property']))     ? ''    : $meta['property'];
                $content    = ( ! isset($meta['content']))  ? ''    : $meta['content'];
                $newline    = ( ! isset($meta['newline']))  ? "\n"  : $meta['newline'];
    
                $str .= '<meta '.$type.'="'.$property.'" content="'.$content.'" />'.$newline;
            }
    
            return $str;
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

should i use Classname() or __construct() as constructor in CodeIgniter? both work, which should
I've delved into Dojo Toolkit which I intend to use with CodeIgniter .
I use CodeIgniter + Tank Auth. Only the code http://localhost/XXXXXXXX/auth/forgot_password doesn't work. The result
In one of my controllers, i use codeigniter's form validation helper. One of my
I am building a Facebook app using iframe rendering. I want to use CodeIgniter
I would use CodeIgniter in my new project, but i only use the helper
I am trying to learn CodeIgniter to use for a shopping site, but I
in codeigniter you can use wildcard to reroute. i never heard the word wildcards
I'm running a LAMP environment with CodeIgniter. I want to be able to use
Is there a way to integrate CodeIgniter with phpBB3? I would like to use

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.