Currently my meta descriptions and keywords are contained in my default.ctp
file located in \app\View\Layouts
. It seems that this results in the same meta description for every page on my site. Hopefully this is okay.
I'm adding new pages to my site and would like to be able to customize the meta description and keywords just for these specific pages. So leave the same generic meta description for most of the website, but for a handful or pages, use custom meta descriptions.
For example, is there code that I can add to the individual .ctp
files located in app\View\Pages
that would then override the meta descriptions found in default.ctp
?
Thanks for any and all help!
I'm not a SEO expert, so I can't tell you how good or bad duplicate descriptions are with respect to page ranking and stuff, however, from my experience, Google for example will tend to prefer page contents over meta descriptions more often in case the description duplicates on many pages, however there doesn't necessarily have to be correlation of course.
That being said, I'd suggest to use view blocks, they can be overriden from anywhere in your templates.
Layout
Update:
startIfEmpty()
was introduced with CakePHP 2.3, in earlier versions it would be necessary to test for an existing block manually, something like for exampleSpecific page template
See http://book.cakephp.org/2.0/en/views.html#view-blocks for more information.