Hi Francesco,<br><br>Thanks for your time and the reply. As far as i know, i can refer to a cck field ( in computed field) as $node->field_data[0]['value']; but i am also wondering how to refer a cck field in node body with php input. according to the suggestion given by "Marcus" (<a href="http://drupal.org/node/466694">http://drupal.org/node/466694</a>), i am trying to use some php code to hide and display a cck field in node body.<br>
<br>Beside this, here is the code i have used for computed field to display and hide a cck field.<br><br>$content1 = $node->field_data1[0]['value'];<br>$content2 = $node->field_data2[0]['value'];<br>
$t=getdate();<br>$today=date('D, m/d/Y - H:s',$t[0]);<br>$due_date = $node->field_whatisdate[0]['value'];<br>if ($due_date >= $today){<br> $node_field[0]['value'] = $content1;<br>}else{<br> $node_field[0]['value'] = $content2;<br>
}<br><br><b>Display:</b><br>$display = $node_field_item['value'];<br><br>This is how i tried but no luck. i still have issues. please check with this. Thanks in advance.<br><br>With regards<br>Mohan<br><br><br><div class="gmail_quote">
On Wed, May 20, 2009 at 4:37 PM, Francesco <span dir="ltr"><<a href="mailto:entuland@gmail.com">entuland@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hi Mohan,<br>
I've read your lines:<br>
<div class="im"><br>
> I'm trying to display/hide a cck field based on the input given in another<br>
> field. My situation is i need to show a cck text field based on the server<br>
> time...if it doesn't matches, I need to display another cck text field.<br>
<br>
</div>and the thread you mentioned on Dupal.org:<br>
<div class="im"><br>
> You can see my details in forum post here <a href="http://drupal.org/node/466694" target="_blank">http://drupal.org/node/466694</a> .<br>
<br>
</div>So far, I wasn't able to understand if the logic should be applied at<br>
input time or at render time.<br>
<div class="im"><br>
> I guess i can do this using "Computed fields". I read and got some clue from<br>
> this post (<a href="http://drupal.org/node/182473" target="_blank">http://drupal.org/node/182473</a> ) but yet i couldnt get this done .<br>
<br>
</div>Maybe computed fields could make it for input time, but in any case it<br>
could be useful if you explain in deeper detail the steps you've<br>
already done and report the PHP you're using, so that others can<br>
reproduce it and check out what's not working.<br>
<br>
If you have to apply the logic only at render time you can achieve it<br>
with Contemplates quite easily.<br>
<br>
Hope this helps,<br>
regards,<br>
Francesco<br>
<font color="#888888">--<br>
[ Drupal support list | <a href="http://lists.drupal.org/" target="_blank">http://lists.drupal.org/</a> ]<br>
</font></blockquote></div><br>