I have to say that finding the location module has made my last two projects a snap.
All the fields in a location are available in a regular Views filter: Location: City, Location: Country, Location: Distance / Proximity
Location: Latitude, Location: Lid, Location: Longitude, Location: Name, Location: Phone, Location: Postal Code, Location: Province, and Location: Street.
In a contextual filter (aka argument) in Views, only some fields are available: Location: City, Location: Country, Location: Distance / Proximity, ocation: Phone, and Location: Province.
Is there a reason the other fields are not included? Is there a way to have those fields? I might have designed myself into a corner expecting the Location: Name field to be available as a contextual filter based on a quick View built with a fixed filter.
Thanks in advance for any help.
| Comment | File | Size | Author |
|---|---|---|---|
| #4 | availableargumentfields-1347432-4.patch | 1.78 KB | greggmarshall |
Comments
Comment #1
greggmarshallOk it wasn't very hard to add the one field I needed, I edited the locations.views.inc file and copied the argument settings from the city field definition to the name field definition and I could use that field.
I hated to hack a module, but it was expedient. Still curious why all the fields that are defined as filters aren't also defined as arguments.
Comment #2
hutch commentedContribute it as a git patch and perhaps it will be ;-)
Comment #3
greggmarshallI will attempt to figure out how over the weekend.
Comment #4
greggmarshallI have a feeling the module authors had a different approach to defining the arguments, but this was a quick and dirty approach.
Comment #5
greggmarshallJust curious if this patch, or a better solution than mine, might be added to the module so I can stop patching every time a new release comes out...
Comment #6
greggmarshallJust bumping this up and seeing if we can get a long term solution committed to the module. The patch submitted still works, just its a pain to keep applying it.
Thanks for consideration.
Comment #7
greggmarshallPatch still works with 3.3, any chance of getting it committed so I can stop patching?
Comment #8
merauluka commentedNotion seconded. It would be great to have this included in dev at least.
Comment #9
goldlilys commentedPatch works with 7.x-3.5 . Hopefully it gets added to the next release or dev.
I'm like greg, why are the other fields not included as contextual arguments?
Comment #10
garbo commentedAs the people above, I, would also like to know why other fields aren't available as contextual filter.
Thanks, Gregg, for your patch.
Comment #11
greggmarshallPatch still works with 7.x-3.7.
Comment #12
jonhattanIt works as expected.