Jump to content

Recommended Posts

Posted

Hi there,

I'm trying to build a page in Processwire where it has a desktop layout of  

Sub Nav | Content Column 1 | Content Column 2

and a mobile layout of 

Content Column 

As you can see the Sub Nav appears and disappears depending on the viewport of the design.

I've been doing a lot of searching and reading and there does not seem to be a way where I can dynamically load / unload the Sub Nav section of the page and reload and render the page again when the view port changes?

Does this mean I need a mobile template and a desktop template for that page?
How would I load each appropriate one?

Are there any PW modules that would help me achieve this task?
(I have already looked at MarkupAdaptive module but the example doesn't seem to show dynamically loading parts of the HTML)

Thanks in advance.

Posted

This kind of stuff is generally solved by CSS media queries - show content on mobile, hide on larger screen sizes. Google for responsive design/layout/grid.

@Beluga: it was close! :)

Posted

Perhaps you'll find your solution here:

http://stackoverflow.com/questions/18890053/php-conditions-depending-on-window-width-media-queries

I guess there are "solutions" with PHP, PHP + Javascript, Javascript...

By the way, a ProcessWire version is missing at "3rd party modules" here: https://github.com/serbanghita/mobile-detect

NB: don't forget to also read the last answer(s).

Edit: see also https://css-tricks.com/forums/topic/how-to-load-a-section-of-content-only-if-the-screen-is-over-a-certain-width/

  • Like 1
Posted

A great way to learn would be a framework that has a responsive design already. The word you are looking for is responsive. There are tons of frameworks that will help you, or you could code everything from scratch and write all of your own media queries as well. I learned a lot from bootstrap and skeleton about this :).

http://www.awwwards.com/what-are-frameworks-22-best-responsive-css-frameworks-for-web-design.html

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...