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

Have You Used The XF 1.3 Responsive Template Code?

Discussion in 'General XenForo Discussion and Feedback' started by DRE, Feb 14, 2014.

  1. DRE

    DRE Well-Known Member

    Hey I didn't know about this feature until a dude told me about it. Any of y'all using it and how?
  2. Brogan

    Brogan XenForo Moderator Staff Member

  3. DRE

    DRE Well-Known Member

    I thought that was only for .css

    I thought that it now applied in normal templates.
  4. Brogan

    Brogan XenForo Moderator Staff Member

    It's been in place since 1.2.
    Nothing has changed in 1.3 with regards to it.
  5. Jeremy

    Jeremy Well-Known Member

    What do you mean? Responsive Design is related to changing the design in resopnse to screen size, mostly done via JavaScript and CSS.
  6. DRE

    DRE Well-Known Member

    template: ad_above_content

    <xen:if is="@enableResponsive">
    html code for a Banner: 360 width
    <xen:else />
    html code for a Banner: 728 width
  7. Brogan

    Brogan XenForo Moderator Staff Member

    See my previous post.
  8. Arty

    Arty Well-Known Member

    Why would you do something like that? enableResponsive is simply a style property, its not an indication of width or anything else.

    If your idea is to serve different content depending on width, you are doing it wrong. It is impossible to put such conditional statements in templates because templates are parsed on server side and browser window width is not known. Width detection is done on client side via ether JavaScript or CSS, which happens after templates have been rendered and sent to client.
    DRE and DBA like this.
  9. DRE

    DRE Well-Known Member

    Thank you for this basic knowledge I lacked. Got hyped over nothing lol.
  10. RobParker

    RobParker Well-Known Member

    I think you're referring to CSS media queries. They were the bits missing from your example code.

Share This Page