view raw
Isengo Isengo - 9 months ago 64
Smarty Question

Using Meta Description in the right place CakePHP 3

I am trying to use meta tags and description in cakephp 3. It is working so far, but I am facing the problem that I canĀ“t put it in the of my page, because my .ctp files are rendered in my default.ctp

So for example I have my menu, footer etc. in my default.ctp and my page for the faq is in the faq.ctp How can I push those

echo $this->Html->meta('description','enter any meta description here');

metadescription in the head tag? Do I need a template language like smarty and use blocks?


In layout:

echo $this->Html->meta('description',$description);

in your faq.ctp or faq() method:

$this->set('description','enter any meta description here');