CRM-9288 Website type improvements: allow multiple websites in Profiles, respect default type and update type options

    Details

      Description

      1. Allow a profile to contain > 1 website field with the Website Type defined for each instance.

      2. When editing a contact and adding a new Website instance, check if is_default has been assigned to the website_type option values - and if so select that option by default in the dropdown field (full edit form or inline edit from contact summary).

      3. Modify website_type options in meta-data for new installs. 'Home' should be removed. The options should be:

      Work (is_default)
      Main
      Facebook
      Google+
      Instagram
      LinkedIn
      MySpace
      Pinterest
      SnapChat
      Tumblr
      Twitter
      Vine

      4. Upgrade website_type option values to add the following. Check if_exists for each using case-insensitive match before insert.
      Google+
      Instagram
      LinkedIn
      Pinterest
      SnapChat
      Tumblr
      Vine

      More discussion at:
      http://forum.civicrm.org/index.php/topic,31928.0.html

      — Original post ----------
      The Website field has many options: Home, Work, Facebook, Main, etc.

      It always defaults to Home when added to a profile, even if this is not appropriate for the contents of the profile (such as a business profile where "Work" or "Main" would be more appropriate).

      Suggestion:

      1. Allow us as admin to select which type of website it is in the profile, and if none is pre-selected, then have the user select.
      2. Allow us to add multiple 'website' fields to a profile, so that we may collect both "home website" and "facebook website" in the same profile. This is a reasonable use case.

        Attachments

          Activity

          [CRM-9288] Website type improvements: allow multiple websites in Profiles, respect default type and update type options
          Jeroen Van Vaerenbergh added a comment -

          I would not consider this a minor issue. It is a common case. I also noticed saving website values from within profiles can be a problem.

          Diego Viegas added a comment -

          I'd like to agree with the proposed option "Allow us to add multiple 'website' fields to a profile, so that we may collect both "home website" and "facebook website" in the same profile. This is a reasonable use case. " That would reduce the need of custom fields to collect this. Thanks.

          Joe Murray added a comment -

          Pradeep, please create a PR that enhances profile creation and use to support the Website Type field for Website fields. This is Suggestion 2 in the Description.

          Joe Murray added a comment -

          Unless there is pushback from Dave Greenberg on http://forum.civicrm.org/index.php/topic,31928.0.html, please change the default website types as indicated in that forum post.

          Joe Murray added a comment -

          I agree with Dave's revision to the issue description above. Please implement.

          Pradeep Nayak added a comment -

          Submitted PR at https://github.com/civicrm/civicrm-core/pull/3094

          On upgrade i have checked for machine name to match new option value for website type(Google+ .. etc). But from UI when we try to add new website type, the machine name is not mandatory and no machine name is generated by civicrm automatically if name field is blank. So do i need to check for label?

          David Greenberg added a comment -

          Pradeep - tested adding a new website type via the recommended UI in 4.4 - the one that is linked from Administer > Customize > Dropdown Options > Website types (http://civicrm44/civicrm/admin/options/website_type?group=website_type&reset=1) and the machine name is set. The 'back-door' URL (http://civicrm44/civicrm/admin/optionValue?gid=47&reset=1) does not do this, but that seems like an edge case AND I don't think we can safely use labels given that they may be in other languages etc. So, the current approach is fine IMO.

          David Greenberg added a comment -

          The PR looks good, but needs testing.

          HOWEVER, there's a bit more work needed. When editing the Website Type option group from Administer > Customize > Dropdown Options > Website Types - currently the is_default property is not shown / not editable. Part of the goal of this issue is to allow admins to set a default which is then respected when adding a new website type in backoffice contact edit (full edit or inline). Hence we need to expose that property

            People

            • Assignee:
              Yashodha Chaku
              Reporter:
              Stoob

              Dates

              • Created:
                Updated:
                Resolved: