Patrick Nelson

IMHO, this is a clean up operation, since usually what causes bugs and regressions is usually a misunderstanding or better put, the "incomprehensibility" of the code.

jenniferaslan

well, I guess I’ll have to wait until Monday when my brother is back and he can clean up his PHP.

Patrick Nelson

and then in your method, that is where you manually "push" your list of images into your ArrayList. From that point on forward, once you've simplified your template, you can then move onto debugging VirtualPages IMHO.

Patrick Nelson

any changes needed are obvious and automatically cascade to the other "feature types"

Patrick Nelson

so the template very clearly shows all of your semantic logic in one easy to read place, so you immediately see the variation

Patrick Nelson

your template simply becomes this, and the $HasModal var and $Image vars are set on a per image basis depending on what is inside ArrayList which is generated by your FeaturedImages method which returns that array list. The array list contains ArrayData which has those properties, e.g. Image', HasModal and FigureClasses (which appears to vary depending on the situation I guess)

  1. <% if $ImageList %>
  2. <div class="images">
  3. <figure class="image $FigureClasses">
  4. <% if $HasModal %>
  5. <a href="#" class="modal-video-link thumbnail">
  6. <% end_if %>
  7.  
  8. <img src="$Image.Link" alt="$Image.Title" width="100%">
  9.  
  10. <% if $HasModal %>
  11. <span class="fa fa-caret-right"></span>
  12. </a>
  13. <% end_if %>
  14. </figure>
  15. </div>
  16. <% end_if %>