Zen Cart Logo
Forums / Templates, Stylesheets, Page Layout / Disable side-boxes on mobile devices diy template

Disable side-boxes on mobile devices diy template

Views: 721

Results 1 to 4 of 4
26 May 2016, 1:22 PM
#1
adrian_cioc_rlan avatar

adrian_cioc_rlan

New Zenner

Join Date:
May 2016
Location:
Bucharest
Posts:
48
Plugin Contributions:
0

Disable side-boxes on mobile devices diy template

Hello guys,

Does anyone now how to display the left side-box only on the main page when viewing from a mobile or a tablet?

I have installed the DIY responsive default template on my v1.5.1 and I need to turn all the side-boxes off for all other pages except the main page.

Tried to test by adding this in the responsive_default.php

if (in_array($current_page_base,explode(",",'contact_us')) ) {
$flag_disable_right =** false**;
$flag_disable_left = false;
}

and this into the responsive_mobile.php

if (in_array($current_page_base,explode(",",'contact_us')) ) {
$flag_disable_right =** true**;
$flag_disable_left = true;
}

it disables the side-boxes for the contact us page on both desktop and mobile, It should heave disabled it only on the mobile version, something isn't working right.

Thank You!

26 May 2016, 1:40 PM
#2
mesnitu avatar

mesnitu

Totally Zenned

Join Date:
Aug 2014
Location:
Lisbon
Posts:
597
Plugin Contributions:
0

Re: Disable side-boxes on mobile devices diy template

Not sure how it's made on responsive template... I think there are some stuff to control layout, but 2 things

If you only want to hide it on certain device screen, you should use media query

@media screen and (min-width: WHATEVER_WIDTHem) {

// your css dont display

}

Or use the $detect->isMobile() (There are some example on the main_page responsive template )

And also, there is a variable: $this_is_home_page that checks if you're on home page

So

if ($this_is_home_page) {

}

“Though the problems of the world are increasingly complex, the solutions remain embarrassingly simple.” ― Bill Mollison

26 May 2016, 2:15 PM
#3
rbarbour avatar

rbarbour

Totally Zenned

Join Date:
Feb 2010
Posts:
2,159
Plugin Contributions:
10

Re: Disable side-boxes on mobile devices diy template

See support thread

7 Jun 2016, 10:37 AM
#4
adrian_cioc_rlan avatar

adrian_cioc_rlan

New Zenner

Join Date:
May 2016
Location:
Bucharest
Posts:
48
Plugin Contributions:
0

Re: Disable side-boxes on mobile devices diy template

rbarbour:

See support thread

Hey, I read the support threat and answered, I tried to do what you said, but it only works on one page, can you please answer...

10x