How to Edit HTML in Head in page.tpl.php
agoodi - January 9, 2009 - 01:05
| Project: | Drupal |
| Version: | 6.7 |
| Component: | database system |
| Category: | support request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | closed |
Jump to:
Description
Okay, I can't figure this out at all - I've looked and looked and looked - almost found a fix but still nothing that works.
In page.tpl.php I want to find the source file that is referenced with this code:
<?php
print $head
?>In my head when I view page source there is:
<head>
<title>mysite.com</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="EditURI" type="application/rsd+xml" title="RSD" href="mysite/blogapi/rsd" />
<link rel="alternate" type="application/rss+xml" title="mysite.com RSS" href="http://mysite.com/rss.xml" />All I want to do is edit the rss link at the very end of the last link rel.
I cannot for the life of me find out where drupal stores the html. I found references to $stored_head and $stored_feed, etc in common.inc but still can't seem to find the original html.
Any help would be great. Thanks.

#1
That link is created by Drupal automatically via the function drupal_add_feed() (see http://api.drupal.org/api/function/drupal_add_feed/6). So you can not override that single value in an elegant way I fear.
Depending on what you want to change you could do some string manipulation (maybe a regexp replace) to the 'head' variable in your theme's *themename*_preprocess_page function.
#2
The Right WayTM depends on what you want to do exactly but, like ugerhard said, you can access the $head variable through a preprocess function.
See here http://drupal.org/node/223430 for general info on the preprocessing functions and here http://drupal.org/node/334228 for an example using the $head variable.
Please post back if that works for you.
- Arie
#3
Looks like agoodi won't be posting any feedback so I'm setting this to fixed.
Feel free to reopen if you think that is wrong.
- Arie
#4
Automatically closed -- issue fixed for 2 weeks with no activity.