Rewrite the output of this field rewrites empty fields

awolfey - April 14, 2009 - 13:34
Project:Views
Version:6.x-2.5
Component:node data
Category:feature request
Priority:normal
Assigned:Unassigned
Status:closed
Description

I'm rewriting a field output as shown in the attachment. I'm outputting the field as a link using a replacement pattern.

If the field is empty, it is still rewritten and the url is the base domain.

I would like for the field output to be empty if the field is empty.

Perhaps my configuration of the field output is wrong?

Thanks

AttachmentSize
link.jpg115.5 KB

#1

amorfati - May 29, 2009 - 17:07
Category:support request» bug report

Having the exact same problem. Field is set to output as a link using a replacement pattern: I expect it to not print anything if the field is empty, but instead it rewrites the field to include the link in all cases. A workaround is to hardcode the replacement in the template files, but that's less than ideal.

#2

mziegmann - June 8, 2009 - 17:30

Subscribing to this issue... having the same problem and looking for a solution. Thanks to anyone who can help with this!

#3

seattlehimay - June 18, 2009 - 21:50

Subscribing. I'm having the same problem, and haven't found a clean solution.

#4

son of nun - June 25, 2009 - 23:37

I am also looking for a solution. Any help or trick would be welcome.

#5

awolfey - June 26, 2009 - 11:23

My solution was to use a custom views field template. That solved it for me. I have not checked since then to see if the problem is fixed.

#6

BenGman - June 28, 2009 - 12:41

Subscribing

#7

merlinofchaos - June 28, 2009 - 17:42
Category:bug report» feature request

This isn't really a bug, it's a feature request. One I intend to work on (maybe someone would like to write a patch?) to provide special handling for empty fields.

#8

merlinofchaos - July 2, 2009 - 00:22
Status:active» fixed

Checked in a new system to allow this to happen.

#9

awolfey - July 2, 2009 - 16:15

Excellent! Thank you. I needed this again just today.

#10

System Message - July 16, 2009 - 16:20
Status:fixed» closed

Automatically closed -- issue fixed for 2 weeks with no activity.

#11

mziegmann - August 6, 2009 - 20:02

Sorry to comment on a closed issue, but I am using Views 2.6, and don't see the system for handling empty fields. I'm not exactly sure what "checked in a new system to allow this to happen" means. Has this feature has been added? Am I missing this functionality somewhere (looking in the configure field settings)? Is this in dev only? Please advise.

If this has been added and I'm just not seeing it, thanks for adding this feature!

#12

Kakulash - August 11, 2009 - 20:29

It's in the latest dev version.

Thanks for adding this! Wish I had seen this post before I had made my own. Going back to take care of that one...

 
 

Drupal is a registered trademark of Dries Buytaert.