tsgrp / HPI

OpenContent Management Suite (OCMS)
http://www.tsgrp.com/products
17 stars 5 forks source link

Empty Divs Throughout OCMS Templates Can Cause Hard To Track Styling and Functionality Changes #2008

Open engerernoah opened 4 years ago

engerernoah commented 4 years ago

Throughout OCMS there are template files which have div tags with no id or class. This can make it much harder to select and style nested items as well as to understand and control the styling caused by these empty divs. A div tag without an id or class essentially does nothing that we can control and thus, when found in code, empty divs should be removed or updated to contain a class/id.

Backbone itself wraps each view with an empty div unless otherwise specified, going forward it may be a good idea to explore if setting the id property on new backbone layouts/views to avoid this could become best practice.

gsteimer commented 4 years ago

@engerernoah - can you give us 2-3 examples of where this is happening so we can analyze what is causing the empty divs?

engerernoah commented 4 years ago

This came about while Ian and I were looking at the rightSideActionHandler.html file which has some empty divs in it that I was going to remove. For other examples I don't know the affect removing them would have but a grep across ocms for "<div>" shows many files that have empty divs. Then regarding backbone empty divs, each view/layout created wraps the template file supplied in an empty div unless an id or class get specified on the view.