While Location allows for address, fax and phone number information, it would be nice if it also offered email address and website address fields for business listings.

CommentFileSizeAuthor
#13 location_email.zip2.51 KBbartezz
#10 location_url.zip2.47 KBbartezz

Comments

jean-bernard.addor’s picture

As well as cell phone.

yesct’s picture

hmmm I'm thinking that regular cck fields can fill that need?

maybe the fancy version of including those kinds of things could be generic: a user interface which could allow an admin to select other cck fields enabled on their site to be part of a meta location. Then that location could include the usual location stuff, and any other cck fields that were added, like a file/picture.

This might be possible now, create a content type meta location, add whatever cck fields you want, and add a location. Then in your content type, business directory entry, for example, add a meta location (or a node reference to it). Or, in your content type, business, allow multiple business diretory entries, or multiple meta location entries.

Tagging.

yesct’s picture

marked #349936: URL associated with location as a duplicate of this issue

socialnicheguru’s picture

if using this method though, how would the item be associated with the location in the location table?

I am using cck location field now and am having issues with proximity filters, etc.

yesct’s picture

if each node only had one location, and if you could make a view that would list the correct nodes, then in the fields, you should be able to select the website or email fields associated with that node (not with the location)...

socialnicheguru’s picture

I use location for venues. It would be great to add the venue url and email address as part of location just like phone or fax now. It is just easier. that's all. just a suggestion :)

yesct’s picture

Issue tags: +location bdragon check

I dont know... this sounds like location is turning into a directory module. Maybe it should be the other way around, use a directory module, and use location as part of that solution?

Or if not use a directory module, create a directory content type, then use location as PART of the solution for that content type. Let that other content type worry about having a venue url and email address.

Thoughts???

jean-bernard.addor’s picture

No sure to understand you.

My first idea for using location was to use location CCK as a repeatable field on the main node. This way, all location field (location phone ...) are repeated for each iteration of the location CKK field, with a clear association. If I put all the phone numbers on the main node, as CCK field, I will not know which one is going with which location, as, as far as I know there is no way to repeat groups of CCK fields, only individual fields can be repeted. This told, it would be extremly nice for me to be able to repeat groups of CCK fields.

I am also considering to have a main node type with references to a secondary node type for locations that way I could add as many CCK field as I want and one single (CCK) location field to the secondary node type. It seems simpler and more powerful from the drupal point of view, but it would be longer and more complicated to enter the data for the users of the site.

yesct’s picture

One idea is to arrange the phone, website and the cck location (so they are associated with the location as you say) in a field group in the cck content type. Give that a try.

I get where you are coming from now, because you have a node that has multiple locations and each location has a field (like phone or website) and so it is easier to just have that be part of the location module. But, like you said, the Drupal way seems to be instead to use the building blocks of location, cck, etc to build what you need. Harder to get going the first time, but is super cool, and you dont have to wait on a maintainer of the project to implement it for you! (any project, not dissing bdragon. love bdragon!)

bartezz’s picture

StatusFileSize
new2.47 KB

I added website field.... here's the zip, unpack in contrib folder.

If anyone needs a email field for location let me know, I'll create it and post it here!

Cheers

socialnicheguru’s picture

email field would be great too!

bartezz’s picture

Will look into that tomorrow!

Cheers

PS. if the add-on I added above worked for you, let it know so maybe it can get committed

bartezz’s picture

StatusFileSize
new2.51 KB

Here ya go....

Cheers

PS. post back if it works!

agileware’s picture

Status: Active » Needs review

Please post patch files instead of zip files.

It is much easier and also the standard on drupal.org

and mark the issue needs review if that is the case.

juicytoo’s picture

I think this is a great idea.

No more needing to use views and relations and arguments and stuff like that, just to achieve the simple purpose of putting things together where they should be.

Thanks for the implementation Bartezz .

bartezz’s picture

@#14

I know patches are the standard... but erm there is nothing to patch here!
These are complete new files including within a directory...

This directory is supposed to be dropped into the contrib directory.
Not sure but as far as I know you can't create directories by means of a patch, nor can you patch none existing files...

Hence a ZIP file...

Cheers

agileware’s picture

FYI,

If you have a copy of the current location module and a copy of your new version (both the whole location directory with everything under it) you can use

diff -rupN old_folder new_folder > patchfile.patch

Of those options, the u & the p are for readability and should be always used. The r makes it recursive, so you get your folders and the N treats missing files as empty, so if a file did not exist before it is created.

bartezz’s picture

Fair enough... didn't know about that. Using Tortoise SVN.

bomarmonk’s picture

I downloaded your zipped modules and placed them in the contrib directory. There was no problem adding the email and url fields to the cck location node. However, the email address entered into the location form does not display when viewing the node.

bartezz’s picture

Hi Bomarmonk,

But the website field IS showing? Weird!
Do you have CCK Content Permissions module enabled?

Cheers

bomarmonk’s picture

Well, after trying the URL field, it didn't display either. I tried both the full node view and the views listing of these locations. I unistalled the location module, reinstalled it, cleared my cache, and resaved the content type with the email and url fields. I'm not sure what might be preventing them from showing up-- could still be a configuration issue on my side.

klonos’s picture

testing both email and url right now... will report back soon.

petethedude’s picture

Thanks for these. I actually needed a couple custom field, so I used your code to create Location region and languages fields. My problem now is that I needed those fields to work as Views filters, but they won't show up under Filters in views. Any quick notions of how I can get them to show up there? I want to create some views blocks that filter by my new region and languages fields.

EDIT: I now realized that it's already coded for Location view types, but Node view types it wasn't. I found the following in location_fax.views.inc and added it to location_email.views.inc on line 27

    // location_email links to node through location_instance via lid.
    'node' => array(
      'left_table' => 'location_instance',
      'left_field' => 'lid',
      'field' => 'lid',
    ),
kloewer’s picture

If you do so, you should probably add:

'help' => t('The Email address of the selected location.'),

to line 34:

// location_email table -- fields

$data['location_email']['email'] = array(
'title' => t('Email'),
'help' => t('The Email address of the selected location.'),
'field' => array(
'click sortable' => TRUE,
),

Hardrocker’s picture

YesCT I am now using the location module for a directory service and using cck fields for name, email and website are all possible with cck. However since location is grouping its cck fields the other fields i mentioned above are left outside of the fieldgroup hence making it very unsightly and confusing to users. The aim is wanting a Name, Email and Website field to fall into the fieldgroup with the options of not collecting info from certain fields when needed as it is with other fields currently. Let me know your views on this please. Cheers!

Hardrocker

mattcasey’s picture

#10 patch works, but you have to edit the location.tpl.php file as well!

Because I use the URL field as a link to the "Name" field, I included this to the top of my file:

<div class="location vcard"><div class="adr">
<div class="fn"><?php
	if ($url) {
	  echo '<a href="' . $url . '">' . $name . '</a>';
	  } else {
	  echo $name;
	  }
?></div>

Also, Theme Developer suggests us-location.tpl.php as a possible template override, but I wish I could create user or node-type overrides as well...

rooby’s picture

Status: Needs review » Closed (won't fix)

I agree with YesCT in #7, the location module is for locative information. CCK and it's related modules, like the email, link, date etc. modules are for this type of thing.

If you really want to go this way about it I recommend creating a new project on drupal.org called location_extra or something.
Then you can add all the fields you like in the manner used in #13.

My full reasoning can be found here #1079764-4: Adding extra fields to the Locative information collected.
(Also, posts #2 & #5 of that issue outline possible solutions for adding more fields to location information.)

bartezz’s picture

As a developer I do agree that email and url fields are not locative information. But putting on my user hat I know it would be more logical usabillity wise to have one fieldset to enter all information on a location. Similar to Google Maps. Which is a combined location directory and works like a charm :)

Location_extra.module sounds like a good plan, will see if I have the time to create a module for this.

Cheers

dizarter’s picture

How to display the location URL and email fields added by plugins in #10 and #13 under views fields?

Thanks!

rooby’s picture

@dizarter:

After a brief look over the code it seems there is some views support there.

After installing the module you should be able to select 'Location: Email' just as you would any other location field.
However, the views support is not complete so it will only work for node views.
Using a user view with user locations is not supported by #10 or #13.

Those modules were probably made when location views support was less comprehensive so they aren't quite as feature rich as the location module fax and phone fields are now.

bartezz’s picture

@rooby; You are right... if I remember correctly the views support was indeed less comprehensive. Anyone needing field views support is welcome to update #10 and #13 :) I'm dealing with chronic lack of time syndrome...

Cheers