CodeIgniter Forums
Meta tag helper with Open Graph tags - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5)
+--- Forum: General Help (https://forum.codeigniter.com/forumdisplay.php?fid=24)
+--- Thread: Meta tag helper with Open Graph tags (/showthread.php?tid=864)



Meta tag helper with Open Graph tags - Smith - 01-23-2015

Hi guys!
I have a problem with the "html_helper". For example, I have this function in a controller:

PHP Code:
[...]

$data['post']      = $this->blog_model->getPost($unix);

foreach(
$data['post'] as $meta)
        {
            
$metas = array(
                array(
'name' => 'og:title''content' => $meta["content"], 'type' => 'property')
            );

            echo 
meta($metas);
        }

        
$this->template->load('template''public/post'$data); 

I try to create labels based on the content you get from a model. The problem is that the meta label is created above the html tag. I extended the html_helper to use Open Graph tags.

Code:
<meta name="description" content="My Great site" />
<!DOCTYPE html>
<!--[if IE 8]>            <html class="ie ie8"> <![endif]-->
<!--[if IE 9]>            <html class="ie ie9"> <![endif]-->
<!--[if gt IE 9]><!-->    <html> <!--<![endif]-->
<head>

I tried to fix this with a validation in the template. but does not work


RE: Meta tag helper with Open Graph tags - stopz - 01-26-2015

You are loading template with an array where ['post'] is your meta data?

Is this template loader suppose to replace some meta tags with data or generate meta data @ some point of file. I assume you should check your template file and see if it has it's anchors/replace_tags placed correctly if it's using any.