CodeIgniter Forums
how to deal with meta info in each page?? - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived General Discussion (https://forum.codeigniter.com/forumdisplay.php?fid=21)
+--- Thread: how to deal with meta info in each page?? (/showthread.php?tid=26436)



how to deal with meta info in each page?? - El Forum - 01-13-2010

[eluser]123wesweat[/eluser]
hi,

ok i am a bit confused as i am trying to make things as simple as possible and prevent an array ($this->data), like
Code:
if ($this->form_validation->run() == FALSE) {
              $this->data = array(
                //should come from the db
                'metadescription'     => "Your page's description here",
                'metakeywords'          => "keywords, keywords, keywords",
                'page'                  => "register_form"
        );
            $this->load->view('template',$this->data);

also

    function registerTest() {
        $this->load->helper('url');
        $this->load->helper('form');
        $this->data = array(
                //comes from the db
               'metadescription'     => "Your page's description here",
                'metakeywords'     => "keywords, keywords, keywords",
                'pagetitle'        => "Nice title",
                'page'              => "form-test"
        );
        $this->load->view('template',$this->data);
    }


or is there another nice way to have more than one variable replaced?


how to deal with meta info in each page?? - El Forum - 01-13-2010

[eluser]Johan André[/eluser]
You should extend your base controller and add methods like:

set_description($desc)
set_keywords($keywords)
set_title($title)

etc


how to deal with meta info in each page?? - El Forum - 02-19-2010

[eluser]123wesweat[/eluser]
@johan,

sorry still struggling with this. Could you give me some coding example???

kind regards