1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Lack of Interest HTML Comments and xen:contentcheck

Discussion in 'Closed Suggestions' started by brstrm, Oct 29, 2014.

  1. brstrm

    brstrm Active Member

    Maybe there is something I am missing here, but from the perspective of a theme guy, it seems that HTML comments shouldn't be considered content by the xen:contentcheck tag.

    I've noticed a few plugins will sometimes throw in HTML comments, and while this is nice, organized and dandy, it sometimes results in elements popping up that ideally shouldn't be hitting the front end (e.g. the user bar in UI.X).

    Just something to chew on. Please, offer your perspective and tell me if I am wrong.
  2. Jeremy

    Jeremy XenForo Moderator Staff Member

    xen:contentcheck should be used to surround the actual generated HTML, so it does a simplistic string test. Anything other than that would get into more complicated areas of coding that seem to be slightly unnecessary for the process of what is needed because you can never guarantee that it will have content. Proper use of it would be to not include constant HTML or with something that will be hidden.
    brstrm likes this.
  3. pegasus

    pegasus Well-Known Member

    Also, if you use <xen:comment> in templates instead of HTML comments, I think those would be ignored by <xen:contentcheck>
  4. brstrm

    brstrm Active Member

    You're correct. My concern was with certain add-ons that throw commented HTML into a template (via a hook or template modification) thus having the content check return true.

    It's a specific case, and isn't worth the exception when making content checks as Jeremy noted. I'm probably just being a picky Peter :p.

Share This Page