<if> condition in templates

For support and discussion related to templates, themes, and imagesets in phpBB 3.1.
Get Involved
Locked
TopSpace
Registered User
Posts: 61
Joined: Fri Feb 20, 2015 1:09 pm

<if> condition in templates

Post by TopSpace » Thu Mar 05, 2015 1:25 am

is there way to disable some of html_code in template in dependence of what version of prosilver is loading: mobile or normal? I've added sidebar code which I saw in article on this site and it prevents loading well prosilver mobile version

User avatar
Arty
Former Team Member
Posts: 16654
Joined: Wed Mar 06, 2002 2:36 pm
Name: Vjacheslav Trushkin
Contact:

Re: <if> condition in templates

Post by Arty » Thu Mar 05, 2015 8:24 am

Do you mean on server side? No.
Window width is checked on client side, so you need to do that via CSS.
Vjacheslav Trushkin / Arty.
Free phpBB 3.1 styles | New project: Iconify - modern SVG framework

TopSpace
Registered User
Posts: 61
Joined: Fri Feb 20, 2015 1:09 pm

Re: <if> condition in templates

Post by TopSpace » Fri Mar 06, 2015 5:25 am

Hm then I dont know how turns on mobile CSS? I mean how fields of last topics etc are going invisible? If I will know mechanism of getting hide this fields, logo and other elements I can set this style to the sidebar I guess?...

User avatar
Arty
Former Team Member
Posts: 16654
Joined: Wed Mar 06, 2002 2:36 pm
Name: Vjacheslav Trushkin
Contact:

Re: <if> condition in templates

Post by Arty » Fri Mar 06, 2015 5:47 am

Media queries.

For example, to hide .whatever at width below 700px css like this is used

Code: Select all

@media (max-width: 700px) {
   .whatever { display: none; }
}
Vjacheslav Trushkin / Arty.
Free phpBB 3.1 styles | New project: Iconify - modern SVG framework

TopSpace
Registered User
Posts: 61
Joined: Fri Feb 20, 2015 1:09 pm

Re: <if> condition in templates

Post by TopSpace » Fri Mar 06, 2015 11:53 am

Hm thats not quite simple as I thought.

Article which I used to make sidebar: https://www.phpbb.com/support/docs/en/3 ... -tutorial/

If I'm trying to make none display to sort of sidebar like "fluidfixed-sidebar" thats doesnot display him but its still take a space but just not showing.

If I'm trying to make none display to whole sidebar "sidebarwrapper" I disable all the content after navbar becase whole content under this <div> sidebar.

Any other ways how to disable sidebar for mobile?

Working url: http://schiza.me

User avatar
KomiDesign
Registered User
Posts: 36
Joined: Sun Nov 23, 2014 1:47 pm

Re: <if> condition in templates

Post by KomiDesign » Sun Mar 08, 2015 1:33 pm

Try this:

Code: Select all

@media (max-width: 700px) {
   .fluidfixed-sidebar { 
        display: none; 
   }   
   .fluidfixed-content {
    	padding-right: 0;
   }
}

TopSpace
Registered User
Posts: 61
Joined: Fri Feb 20, 2015 1:09 pm

Re: <if> condition in templates

Post by TopSpace » Sun Mar 08, 2015 2:29 pm

Thanks, mr. Komi. It works.

Locked

Return to “[3.1.x] Styles Support & Discussion”