Details

    • Type: Sub-task
    • Status: Done/Fixed
    • Priority: Major
    • Resolution: Fixed/Completed
    • Affects Version/s: 4.4.0
    • Fix Version/s: None
    • Labels:
      None

      Description

      For CRM-12863, we would like to apply a very small amount of CSS to specific profile forms. To do this properly (without affecting other profiles that are concurrently embedded in the same page), we should:

      1. Add

      {crmRegion name="profile-NAME"}

      to Dynamic.tpl
      -> this allows one to inject code in the profile programmatically

      2. Add <div class="crm-profile-NAME"> to Dynamic.tpl
      -> this allows one to manipulate layout/rendering of profile with CSS

      3. Define hooks for the "build/validate/process" phases of profile-form-processing and the "run" phase of profile-page-processing. The hooks should emit the NAME of the profile form.
      -> This isn't strictly needed. It can be done with the buildForm/validateForm/postProcess/pageRun hooks, but it's a bit verbose/cumbersome because (a) you have to check for CRM_Profile_Form_Dynamic (or similar) and (b) you have to get the profile GID, and (c) you have to map the GID to the profile's name to determine if it's the right profile. With a large #modules, this will become a lot of checks. More generally, from the perspective of a developer working with profiles, it feels a bit leaky to dig into the properties of CRM_Profile_Form_Dynamic.
      -> This could be done by defining a parallel set of hooks (hook_civicrm_buildProfile, hook_civicrm_validateProfile, hook_civicrm_processProfile, hook_civicrm_runProfile).
      -> This could (mosty) be done by calling the existing hooks an extra time with a better $formName – e.g. hook_civicrm_buildForm($formName,...) where "$formName" is "CRM_Profile::my_uf_group_name".

      Note: Before closing the ticket, please update the Region Reference, Hook Reference, and API changelog.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                timotten Tim Otten
                Reporter:
                timotten Tim Otten
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Time Tracking

                  Estimated:
                  Original Estimate - 1 day, 4 hours
                  1d 4h
                  Remaining:
                  Time Spent - 4 hours, 30 minutes Remaining Estimate - 7 hours, 30 minutes
                  7h 30m
                  Logged:
                  Time Spent - 4 hours, 30 minutes Remaining Estimate - 7 hours, 30 minutes
                  4h 30m