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.

Comments

greggmarshall’s picture

Ok 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.

hutch’s picture

Contribute it as a git patch and perhaps it will be ;-)

greggmarshall’s picture

I will attempt to figure out how over the weekend.

greggmarshall’s picture

StatusFileSize
new1.78 KB

I have a feeling the module authors had a different approach to defining the arguments, but this was a quick and dirty approach.

greggmarshall’s picture

Just 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...

greggmarshall’s picture

Just 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.

greggmarshall’s picture

Issue summary: View changes

Patch still works with 3.3, any chance of getting it committed so I can stop patching?

merauluka’s picture

Notion seconded. It would be great to have this included in dev at least.

goldlilys’s picture

Patch 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?

garbo’s picture

As the people above, I, would also like to know why other fields aren't available as contextual filter.

Thanks, Gregg, for your patch.

greggmarshall’s picture

Patch still works with 7.x-3.7.

jonhattan’s picture

Status: Active » Reviewed & tested by the community

It works as expected.