cck_map and ConTemplate - map does not display when using ConTemplate
| Project: | cck_map |
| Version: | 5.x-3.3 |
| Component: | Code |
| Category: | support request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | active |
Jump to:
Hi,
Thank you for a great module. I have a question that I'm hoping you can help with. I am using cck_map on an 'Event' content type with some other CCK fields. I'd like to use the ConTemplate module to theme this content type as there's some things I'd like to change about the other CCK fields - I'm not too bothered about theming the cck_map field. However, before editing these other fields in ConTemplate, and using the 'default' body template provided by ConTemplate, the cck_map field is no longer displaying properly. Before doing any editing, ConTemplate provides the following as template code for the cck_map field:
<div class="field field-type-map-location field-field-eventmap">
<h3 class="field-label">Map</h3>
<div class="field-items">
<div class="field-item"><?php print $node->field_eventmap[0]['view'] ?></div>
</div>
</div>While I can see 'Map' header, the map itself is no longer displayed. I have tried substituting / appending $node ->field_eventmap[0]['view'] with various other 'body variables' suggested by ConTemplate (e.g. $node->field_eventmap[0]['image']), but I can't get the map to appear. Can anyone help? As mentioned, I'm happy to keep the cck_map field displaying as it is, but not really knowing PHP I'm not sure what I need to print to keep it there.
Thanks in advance
Paul

#1
Try using:
$node->content['field_**YOUR_CCK_MAP_FIELD***']['#value']
it works for me.
Matteo
PS: still quallering with title/description for marker...
#2
Hi, I'm not too hot on how drupal sorts out all this stuff, but do I need to replace
<?phpforeach ((array)$node->field_map as $item) {
?>
<?php
print $item['view']
with
<?php foreach ((array)$node->field_map as $item) {
?>
<?php print $node->content['field_map']['0']
as thatdoesnt' seem to work for me? What did I miss?
Many thanks guys
Matt
#3
for anyone else that's as daft as me you need to replace
<div class="field field-type-map-location field-field-map"><h3 class="field-label">Map</h3>
<div class="field-items">
<?php foreach ((array)$node->field_map as $item) { ?>
<div class="field-item"><?php print $item['view'] ?></div>
<?php } ?>
</div>
</div>
with
<div class="field field-type-map-location field-field-map"><h3 class="field-label">Map</h3>
<div class="field-items">
<div class="field-item"><?php print $node->content['field_**YOUR_CCK_MAP_FIELD***']['#value'] ?></div>
</div>
</div>
#4
fixed for me.