I am in the process of moving my flexinode data to CCk and upgrading my site to 5.0. I have quite a few custom node.tpl files that need to get imported into CCK templates. I'm using contemplate and everything works rather nicely except one crucial problem. The book navigation links and "add another location" links (for location module) just don't show for my customized CCK node. The rest of the template works great, but I can't get these important navigational elements to display with my custom template. I am about to go crazy. I went through this same problem with flexinode and my node.tpl files. The fix that I found for flexinode will not work with my contemplates! Can
someone help? Shouldn't contemplate simply incorporate, by default, the expected node related links for a drupal node?
Here is the solution that I found for my flexinode templates:
http://drupal.org/node/25567#comment-45897
I can get everything to show by simply using
<?php print $body ?>
Here is a copy of contemplate content thus far.
<div class="special_content">
<div id="about_node">
<div id="org_header">
<h3 class="field-label">About</h3>
</div>
<div id="address_pad">
<div id="org_image">
<div class="field-items">
<?php foreach ((array)$field_header_image as $item) { ?>
<div class="field-item"><?php print $item['view'] ?></div>
<?php } ?>
</div>
</div>
<div class="field-items">
<?php foreach ((array)$field_about as $item) { ?>
<div class="field-item"><?php print $item['view'] ?></div>
<?php } ?>
</div>
</div>
</div>
</div>
<br />
<div id="about_node">
<div id="org_header"><h3>Contact Information</h3></div>
<div id="address_pad">
<div class="field field-type-ca-phone field-field-phone">
<h3 class="field-label">Phone</h3>
<div class="field-items">
<?php foreach ((array)$field_phone as $item) { ?>
<div class="field-item"><?php print $item['view'] ?></div>
<?php } ?>
</div>
</div>
<br />
<?php if (content_format('field_fax', $field_fax[0]) > '') : ?>
<div class="field field-type-ca-phone field-field-fax">
<h3 class="field-label">Fax</h3>
<div class="field-items">
<?php foreach ((array)$field_fax as $item) { ?>
<div class="field-item"><?php print $item['view'] ?></div>
<?php } ?>
</div>
</div>
<?php endif; ?>
<br />
<?php if (content_format('field_e_mail', $field_e_mail[0]) > '') : ?>
<div class="field field-type-email field-field-e-mail">
<h3 class="field-label">E-mail</h3>
<div class="field-items">
<?php foreach ((array)$field_e_mail as $item) { ?>
<div class="field-item"><?php print $item['view'] ?></div>
<?php } ?>
</div>
</div>
<?php endif; ?>
<?php print theme('locations', $locations); ?>
</div>
</div>
</div>
</div>
</div>
</div>
[edit: sepeck - fixed code tags]
Comments
Ah ha!
I actually had this problem with another project and forgot about it. I rediscovered the solution here:
http://drupal.org/node/93935
I'm not sure why this patch hasn't already been included in the content and contemplate modules. Wouldn't any reasonable user expect contemplate to allow modules to add content to a node by default? I still want to kill the contemplate module until this solution (or another like it) is provided with the official module. Until then, contemplate is basically broken, right? Maybe I'm overreacting, but each time I have to track something down like this, it takes considerable time. Instead, I just wish the module would work with existing Drupal features without patching and a scratching of the head. I still don't see an easy way to include the output of the book navigation and location modules in a contemplate. If there is another way to include these variables without a patch, I would probably use that solution.
Still a Frustrating Problem
See my other comments in the issue linked above. If this issue is patched, there seems a fine chance of improving the usability of Drupal for the less technical non-php folks out there. The thing is, there is already patch, so can't it easily be updated for Drupal 5 and beyond? Include this patch in the core of cck and the contemplate module? Why not?