开发者

Drupal 7: using CCK field in html.tpl.php for custom page title for each entry

I need to give a custom meta title to each page. I found a module http://drupal.org/project/page_title but I cant give particular title to entry with that.

I created MetaTitle field for my CCK. then I edited html.tpl.php as below, and it doesn't take action. do I call my cck field wrong way? :/

/sites/all/themes/zen/html.tpl.php

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<?php print $language->language; ?>" version="XHTML+RDFa 1.0" dir="<?php print $language->dir; ?>"<?php print $rdf_namespaces; ?>>

<head profile="<?php print $grddl_profile; ?>">
  <?php print $head; ?>
  <title><?php print $node->field_meta_title[0]['view']; ?></title>
  <?php //print $head_title; I removed the line ?>

开发者_JS百科What am I missing? Appreciate helps!!! Thanks a lot!


I can't give you an exact answer, but I'm pretty sure you don't want to be editing anything in the modules folder to do this.

You'll probably find that the place to do this is in your theme. The exact location varies by theme, but you should be able to find it with a minimal amount of hunting.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜