You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@netbeans.apache.org by GitBox <gi...@apache.org> on 2022/10/27 15:25:24 UTC

[GitHub] [netbeans] sarelvdm commented on issue #4869: Twig Indenting code format, not indenting correctly

sarelvdm commented on issue #4869:
URL: https://github.com/apache/netbeans/issues/4869#issuecomment-1293702752

   
   Hi, thanks for responding.
   
   The Twig conditions **"IF statement or the For loop"** should take preference in alignment over HTML Code.
   You can align HTML code inside the Twig condition 
   
   Example 
   "if" 
   -- "Html code" 
   "else" 
   -- "Html code" 
   "endif"
   
   The For loop should work similar
   
   
   {% block content %}
       <div class="container">
           <div class="row">
               <div class="box col-8">
                   <div class="card">
                       <div class="card-body">
   
                           {#Im selecting between 2 routes, based on variable input.#}
                           {#The if else endif should be alligned marked with ** #}
                           {% if nextmemberid == ''%} {#**#}
                               <form action="{{ route('accmember',{_memberid:currentmember.memberid}) }}" method="POST">
                                   <input type="hidden" name="memberid" value="{{ currentmember.memberid }}">
                               {% else %} {#**#}
                                   <form action="{{ route('accmember',{_memberid:nextmemberid}) }}" method="POST">
                                       <input type="hidden" name="memberid" value="{{ nextmemberid }}">
                                   {% endif %} {#**#}
                                   <input type="hidden" name="{{ csrf.key }}" value="{{ csrf.token }}">
   
                                   <div class="row">
   
                                       <div class="col-md-6 mb-3">
                                           <div class="form-floating form-floating-group flex-grow-1">
                                               <input class="form-control{{ errors.firstname ? ' is-invalid' : '' }}" 
                                                      id="firstname" name="firstname" placeholder="firstname" 
                                                      {% if currentmember.firstname|trim is not empty %} {# The if should be alligned with AAA #}
                                                          value="{{ currentmember.firstname }}">
                                               {% else %}  {# AAA #}
                                                   value="{{old.firstname }}"> 
                                               {% endif %}  {# AAA #}
                                               <label for="uafirstname">First name</label> 
                                               {% if errors.firstname %}
                                                   <div class="invalid-feedback">
                                                       <label for="floatingInputInvalid">{{ errors.firstname | first }}</label>
                                                   </div>
                                               {% endif %}
                                           </div>
                                       </div> 
   
                                   </div>
                                   <button type="submit" class="btn btn-outline-primary btn-sm">Update</button>
   
                               </form>
                       </div>
                   </div>
               </div>
           </div>
       </div>
   {% endblock %}
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists