Jump to:
| Project: | Address Field |
| Version: | 7.x-1.x-dev |
| Component: | User interface |
| Category: | support request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | closed (works as designed) |
Issue Summary
I'm setting up a View where I need to display components of the address (specifically just "city, province") and so I'm using "rewrite results" and putting in the tokens for just those two items. I then go down and turn on "hide if empty", with the assumption that it'll hide the result of there's no city and province. Of course, it doesn't work that way at all, because the field isn't considered empty if some other part of the address is filled in. (In this case, the business name is filled out, but not shown/used in this view).
Is it possible create an appropriate combination of address field or custom text fields to only show city and province if THEY exist, otherwise show nothing?
(I'm hoping there's a way to do this in the UI; I'm a danger to myself and others if I have to delve into the code.)
Comments
#1
Unfortunately, there's nothing we can really do here in the UI, and I'm not sure what you would be able to do in code. The issue is exactly as you've described it - "Hide if empty" works based on the field value - whether or not there's any data stored for the field, not just whatever your rewritten output is. The best idea I'd try would just be a Views template for the field that just doesn't display anything when you don't want it. But I doubt that would also be able to hide the whole column if it was empty.