<span class="Apple-style-span" style="border-collapse: collapse; "><span style="border-collapse: collapse; ">sebastian,</span><div><span style="border-collapse: collapse; "><br></span></div><div><span style="border-collapse: collapse; ">Actually don't need to touch view or view template. The more 'natural' way is to check it under phptemplate_preprocess_node, if the field's content does not exist, add an additional CSS class to the node (says 'no-field-A'). This way you theme the node + the view or other ways that you retrieve a node.</span><br>
</div><div><span style="border-collapse: collapse; "><br></span></div><div><span style="border-collapse: collapse; ">In your CSS, just theme</span></div><div><span style="border-collapse: collapse; ">.no-field-A .field-A {</span></div>
<div><span style="border-collapse: collapse; "> display: none;</span></div><div><span style="border-collapse: collapse; ">}</span></div><div><span style="border-collapse: collapse; "><br></span></div><div><br></div></span>Cheers,<br>
CK Ng<br><br>forDrupal Premium Themes (<a href="http://fordrupal.com" target="_blank">http://fordrupal.com</a>)<br>- we make drupal beautiful<br>
<br><br><div class="gmail_quote">On Fri, Apr 10, 2009 at 2:19 AM, <span dir="ltr"><<a href="mailto:themes-request@drupal.org" target="_blank">themes-request@drupal.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
<br>
Message: 1<br>
Date: Wed, 08 Apr 2009 17:56:46 -0700<br>
From: sebastian <<a href="mailto:inforazor@gmail.com" target="_blank">inforazor@gmail.com</a>><br>
Subject: [themes] how to stop a 'view' from showing a field?<br>
To: <a href="mailto:themes@drupal.org" target="_blank">themes@drupal.org</a><br>
Message-ID: <<a href="mailto:49DD47CE.9070008@gmail.com" target="_blank">49DD47CE.9070008@gmail.com</a>><br>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed<br>
<br>
Hello listers,<br>
<br>
Hope this is the right place to ask this question.<br>
<br>
I am building a theme and I have little icons that I want to have<br>
appearing when there is a 'File - CCK' field present.<br>
<br>
The field is optional in the content-type. I have created a view for the<br>
page that shows the content, and when the file-cck field is empty, it<br>
still shows all the surrounding <div> and <a href> tags, which triggers<br>
my CSS and then I still show the little custom PDF icon; only I want it<br>
to be blank.<br>
<br>
When I click on the View for the field: file-cck (generic files)<br>
<br>
I only see the options:<br>
<br>
- Exclude from display<br>
- Rewrite output field<br>
- Output this field as a link<br>
- Trim to max length<br>
- Link this to its node<br>
- Label [none/drop down]<br>
- Format [generic files]<br>
<br>
I can't see from this list any way to have it be conditional; ie: only<br>
display Field formatting [Div+a href] if there is actually any data present.<br>
<br>
Thanks for your help, hopefully this is an easy one.<br>
:)<br>
<br>
Kind,<br>
<br></blockquote></div><br>