[eluser]tecrik[/eluser]
Ok, so this is probably a trivial problem, but I don't really know how to get it done. I want to assign meta tags to each of my controllers and/or the functions of those. My plan was, to include something link this in either the Constructor and/or the respective function(s):
Code:
$this->data = array(
'titletag' => "Your title tag here",
'metadescription' => "Your page's description here",
'metakeywords' => "keywords, keywords, keywords",
'pagetitle' => "Tampa Business Directory",
'content_view' => null,
'content_data' => ''
);
For the views, I have a function view_template in MYController to include other template parts etc, so whenever I call a view it kinda looks like this:
Code:
$content = $this->parser->parse('produkte/template', array('produkte' => $query), true);
$this->view_template($content);
In the view_template function I can define a variable such as
Code:
$data['titletag'] = 'title tag is working';
and then call it in my actual template using
Code:
<?=$titletag;?>
What won't work is this
Code:
$data['titletag'] = $titletag;
The question now is, how to pass the variable or rather all variables all the way through from the controller to the view_template function in MYcontroller on to the actual template/view.
If you have any other advice on how to do SEO with CI and make things a little easier, I am open for suggestions!
Thanks so much in advance!