adding conditional to check for checkbox custom field to change the order of the...
authorAnthony Talarico <talarico@gaslightmedia.com>
Fri, 3 Aug 2018 20:05:54 +0000 (16:05 -0400)
committerAnthony Talarico <talarico@gaslightmedia.com>
Fri, 3 Aug 2018 20:05:54 +0000 (16:05 -0400)
changing the order of the markup for the custom fields checkboxes so that the label is to the right of the checkbox

css/admin.css
views/admin/entity/fields.html

index 9973263..4a28958 100644 (file)
@@ -18,3 +18,9 @@
         width: 100%;
     }
 }
+.glm-custom-field-checkbox-wrapper{
+    display: inline-block;
+}
+.glm-custom-field-checkbox-wrapper .glm-custom-field-checkbox-label, .glm-custom-field-checkbox-wrapper .glm-custom-field-checkbox-field{
+    float: left;
+}
\ No newline at end of file
index b0e9b53..b6e93e0 100644 (file)
@@ -6,8 +6,17 @@
         <fieldset>
 
             {foreach $group.custom_fields as $field}
-            <div class="glm-small-12 glm-large-2 glm-columns glm-custom-field-label {if $field.required.value == 1} glm-required {/if}">{$field.field_name}</div>
-            <div class="glm-small-12 glm-large-9 glm-columns glm-custom-field">
+
+
+            {if $field.field_type.value == 'checkbox'}
+                <div class="glm-custom-field-checkbox-wrapper">
+                
+                <div class="glm-custom-field-checkbox-field">
+            {else}
+                <div class="glm-small-12 glm-large-2 glm-columns glm-custom-field-label {if $field.required.value == 1} glm-required {/if}">{$field.field_name}</div>
+                <div class="glm-small-12 glm-large-9 glm-columns glm-custom-field">
+            {/if}
+            
                 <input type="hidden" name="custom-required" value="{$field.required.value}">
 
                {$fail = ''}
                     {/if}
                </div>
             </div>
+            {if $field.field_type.value == 'checkbox'}
+                <div class="glm-custom-field-checkbox-label {if $field.required.value == 1} glm-required {/if}">{$field.field_name}</div>
+                </div>
+            {/if}
         {/foreach}
 
         </fieldset>
             </div>
         {/foreach}
     {/if}
-</div>
+</>