Uploaded image for project: 'CiviCRM'
  1. CiviCRM
  2. CRM-914

Use new smarty {edit} plugin to conditionally hide description blocks in view mode

    Details

    • Type: Improvement
    • Status: Done/Fixed
    • Priority: Minor
    • Resolution: Fixed/Completed
    • Affects Version/s: None
    • Fix Version/s: 1.5
    • Component/s: None
    • Labels:
      None

      Description

      We now have a cleaner way of NOT showing descriptive blocks in forms when we are in "view" mode. Rather than using this syntax:

      {if $action neq 4}
      <dt> </dt><dd class="description"> {ts}Are users required to complete this field?{/ts}</dd>
      {/if}

      ... we just surround the element/code that we only want to show during create/update with the {edit}{/edit} tags:
      {edit}
      <dt> </dt><dd class="description"> {ts}Are users required to complete this field?{/ts}</dd>
      {/edit}

      I've updated the first field in templates/UF/Form/Field.tpl as an example.

      Please search for the conditional {if $action neq 4}

      in existing templates and update to use the new syntax.

      NOTE: We can't use this for if/else situations - so there will still be some places where we need to retain the conditional syntax.

        Attachments

          Activity

            People

            • Assignee:
              kurund Kurund Jalmi
              Reporter:
              dgg David Greenberg
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: