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

XF 1.4 Hiding Elements - CSS. vs Removing/Commenting Out

Discussion in 'Styling and Customization Questions' started by Amaury, Jul 3, 2015.

  1. Amaury

    Amaury Well-Known Member

    Just a general query.

    I know either way works--which means the "if it works, then it doesn't really matter" comes into play here--but when it come to wanting to hide things like the forum list title, the likes bar, etc., what's generally better?

    CSS:

    Code:
    .forum_list .titleBar h1 {
        display: none;
    }
    Or removing/commenting out in the corresponding template:

    Code:
    <xen:comment><xen:h1>{$xenOptions.boardTitle}</xen:h1></xen:comment>
     
  2. Brogan

    Brogan XenForo Moderator Staff Member

    If you don't want it rendered in the output, comment it out.

    A browser inspector will allow hidden elements to be seen.
     
    Amaury likes this.
  3. Amaury

    Amaury Well-Known Member

    Just to clarify, that's if you use CSS to hide elements, correct?
     
  4. Brogan

    Brogan XenForo Moderator Staff Member

    Correct.
     
    Amaury likes this.
  5. Dylan V

    Dylan V Well-Known Member

    I generally prefer to hide elements with the CSS, because it's much faster. I don't really feel the difference to comment or hide an element with the CSS. It's like it was the same thing.
     
  6. James

    James Well-Known Member

    If you comment with xen:comment then that code is not rendered at all and doesn't appear in the output of the page. If you hide with css or html comments then that information is still accessible via the page source.
     
    Amaury likes this.
  7. Dylan V

    Dylan V Well-Known Member

    Yes, I know, but I prefer hide with CSS.
     
    Last edited: Jul 4, 2015
  8. James

    James Well-Known Member

    Fair enough. Personally if I was hiding something for the purpose of not wanting it there I'd use xen:comment. It's a good practice to get into.
     
    Amaury likes this.

Share This Page