Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

CakePHP Canonical Tag with html helper

How can I create this using the html helper? (with inline=false so i can specify it on a per-view basis)

<link rel="canonical" href="http://www.example.com/product.php?item=swedish-fish" />

Can't seem to find anything on this, apart from a patch that doesn't work.

like image 507
Chris J Allen Avatar asked Mar 15 '11 09:03

Chris J Allen


1 Answers

It seems my friend just told me that I told him how to do this a few months back, problem solved...

<?php echo $this->Html->meta('canonical', 
    'http://www.example.com/product.php?item=swedish-fish', 
    array('rel'=>'canonical', 'type'=>null, 'title'=>null, 'inline' => false)
);?>
like image 83
Chris J Allen Avatar answered Sep 18 '22 13:09

Chris J Allen