I am having trouble getting the field to display. I copied the body from contemplate into a custom node.tpl.php file but it is only displaying the h3 tag. below is the code.
<div class="field field-type-office-hours field-field-hours">
<h3 class="field-label">Hours of Operation</h3>
<div class="field-items">
<?php foreach ((array)$node->field_hours as $item) { ?>
<div class="field-item"><?php print $item['view'] ?></div>
<?php } ?>
</div>
</div>
Comments
Comment #1
Ozeuss commentedThis is because there is no $item['view'], but an $item['day'], $item['starthours'], and $item['endhours'].
Comment #2
TaPes commentedcan you be a little bit more specific?
i tried this:
i get this output:
but i need:
Comment #3
Ozeuss commentedThe days are stored as integers, you'll need something like
for the day itself to show.
For some reason, you template displays only saturday. I'm not familiar with contemplate or the method you're pulling the $node->field_name, so i can't help you there.
Comment #4
TaPes commentedyeah i have found out that only the last day that you select appears on the site. but i have the same problem when i don't use a template:
instead
Never mind, i use cck time, now
Comment #5
johnvPlease re-open if this issue still arises in D6/D7.