Phantom template file? I've inherited a site running a custom Zen sub-theme.

It uses standard CCK content types with several "page-node-" and "node-" template files for layout control.

The original designer used the .tpl files to manually embed various views and blocks (with specific HTML structure for styling) into different pages throughout the site.  As you can imagine, these views and blocks can not be directly configured through the UI.

One page however has some block like sidebar image elements that cannot be manipulated through the UI and appear to be embedded via a template file, but I can't find a template file in either the sub-theme or base theme (zen) directory that would affect this page at the page level. There is a node level template, but it only affects the content area, not the right sidebar.

From the source, I can see that they are not actual blocks as they simply have "&lt;p&gt;" tags around them  

&lt;div id="sidebar-right-inner" class="region region-right"&gt;

    &lt;p&gt;&lt;a href="myurl" title="title"&gt;&lt;img src="path/image.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;


    &lt;div id="block-block-39" class="block block-block region-even even region-count-2 
     count-6 with-block-editing"&gt; ...


The element between #sidebar-right-inner and #block-block-39 simply has a &lt;p&gt; tag with no drupal classes or ids.  This is what needs to go.  Block-block-39 has been configured through the "blocks" administration page and is supposed to be there.  

If it were indeed embedded via template file, I should have a file like sites/all/themes/mytheme/pages/page-node-15.tpl.php, but I don't.  I've checked Page.tpl.php in both sub-theme and base theme (and every other .tpl file) and cannot figure out how these elements are getting there!  Is there somewhere else that a block of HTML could be embedded?

I've tried disabling Javascript on my browser with no change.  And if it were created through the UI somehow, I'm thinking it would have additional divs wrapped around it or other classes / ids.  

I think I have a pretty good handle on how templates work (hierarchically speaking), and I've spent days searching for an answer. I'm sure I'm missing something silly, but I'm pretty stumped at the moment. 

I basically need to just get rid of them.
Ok, these elements do not display an "edit block" option when I am logged in as an admin and mouse hover them, nor do they display any of the HTML class / id properties which are typically associated with a block.  So It had to be somehow injected or modified VIA a template file.

I did however, finally discover that they were in fact being added via a cryptically named block.

This meant that it was likely being acted upon by a "block-" template. Armed with the newly discovered block number, I found that the file "block-block-22.tpl.php" was stripping the edit link and other divs and formatting to prevent the block from having it's own background etc.

The standard "block.tpl.php" file writes all blocks in the sub-theme like:

&lt;div id="block-&lt;?php print $block-&gt;module . '-' . $block-&gt;delta; ?&gt;" class="&lt;?php print $classes; ?&gt;"&gt;
    &lt;div class="block-inner"&gt;

  &lt;?php if ($block-&gt;subject): ?&gt;
    &lt;h2 class="title"&gt;&lt;span&gt;&lt;?php print $block-&gt;subject; ?&gt;&lt;/span&gt;&lt;/h2&gt;
  &lt;?php endif; ?&gt;

  &lt;div class="content"&gt;
    &lt;?php print $block-&gt;content; ?&gt;
  &lt;/div&gt;

  &lt;?php print $edit_links; ?&gt;

&lt;/div&gt;&lt;/div&gt; &lt;!-- /block-inner, /block --&gt;


Whereas "block-block-22.tpl.php" was overriding the default and writing it as such:

&lt;?php print $block-&gt;content; ?&gt;


effectively stripping all of the block's formatting so that only the images that it contained would show with no extra margin, padding, background etc. 

I had a feeling I was missing something simple... 

Furthermore, changing it to:

&lt;?php print $edit_links; ?&gt;
&lt;?php print $block-&gt;content; ?&gt;


Enabled the "edit block" link for administrators, so now it can be edited directly from the page.