Menu icon Foundation
Calling different php files based on media

I am brand new to Foundation 5 and _anything_ but a world class coder. :)

My question regards an ecommerce site. I would like to use a product grid on large media and your pricing table on medium and small media.

This requires two distinct, fairly large blocks of php, one for each display type. I can't figure out how to toggle between the two blocks of code and I suspect the question is too basic to come up in my goolging. :)

I have tried Interchange and while it will parse some php it doesn’t work as a normal included file would. Specifically, it doesn’t seem to inherit global values.

Is there something obvious I am missing here or some other way to do this?

Thanks for any help you can provide.

data interchangePHP

I am brand new to Foundation 5 and _anything_ but a world class coder. :)

My question regards an ecommerce site. I would like to use a product grid on large media and your pricing table on medium and small media.

This requires two distinct, fairly large blocks of php, one for each display type. I can't figure out how to toggle between the two blocks of code and I suspect the question is too basic to come up in my goolging. :)

I have tried Interchange and while it will parse some php it doesn’t work as a normal included file would. Specifically, it doesn’t seem to inherit global values.

Is there something obvious I am missing here or some other way to do this?

Thanks for any help you can provide.

Rafi Benkual over 4 years ago

Does it have to be php?

Interchange was my suggestion for html partials.

Phil He over 4 years ago

Yes, unfortunately, php it is. Can visibility classes be used to hide or show functions?

Kristopher Larson over 4 years ago

Hrmm, maybe if you call two separate instances of object your trying to display one for the large page and one for the medium page and small page.

Rachel Vasquez over 4 years ago

@Rafi Benkual Thanks for referring to my blog on RachieVee. :-)

Assuming this is not WordPress that Phil is working off of - is there any reason why you can't separate those two blocks of PHP into partials? I had an issue with using PHP at first as well used includes, maybe this thread will help?

http://foundation.zurb.com/forum/posts/21954-getting-lag-with-interchange-in-wordpress