2017 © Pedro Peláez
 

neos-package ress

Ttree Responsive Web Design with Server-Side Component

image

ttree/ress

Ttree Responsive Web Design with Server-Side Component

  • Wednesday, June 20, 2018
  • by ttree
  • Repository
  • 3 Watchers
  • 5 Stars
  • 120 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 3 Versions
  • 1 % Grown

The README.md

Ttree - Responsive Web Design with Server-Side Component

Description

Responsive Web Design is really really trendy (and mandatory) today. But in some cases it's not the best solution., (*1)

Most responsive website serve exactly the same amount of bits to desktop, tablet or mobile user. Many mobile user will leave your website if the loading time is to long. Or sometimes your design need a different markup to support your design decisions., (*2)

If you are intersted by this topics, you can read those articles:, (*3)

What's include in this package ?

This package include the library MobileDetect and extend the Action Request class with two new methods:, (*4)

  • ActionRequest::isMobile()
  • ActionRequest::isTablet()

You can use those methods in your own controller, Fusion prototypes, ..., (*5)

No magic everything is configurable

Tweak a Fusion prototype to change the rendering by device type

prototype(Your.Package.CustomElement) < prototype(Neos.Fusion:Case) {
    default {
        condition = ${request.mobile}
        itemRenderer = Your.Package.CustomElementDefault
    }
    default {
        condition = true
        itemRenderer = Your.Package.CustomElementDefault
    }

    @cache {
        mode = 'dynamic'
        entryIdentifier {
          node = ${node}
        }
        entryDiscriminator = ${request.mobile : 'mobile' ? 'default'}
        context {
                1 = 'node'
                2 = 'documentNode'
        }
        entryTags {
                1 = ${'Node_' + node.identifier}
        }
    }
}

By using the dynamic caching mode you don't need to configure the upper cache segments., (*6)

Completly different markup for Mobile, Tablet & Desktop

You can override your root Fusion conditions to select different rendering for different type of client:, (*7)

root {
    mobile {
        @position = 'before default'
        condition = ${request.mobile && Configuration.setting('Ttree.Ress.enable.mobile') == true}
        type = 'Your.Package:MobilePage'
    }
    tablet {
        @position = 'before default'
        condition = ${request.tablet && Configuration.setting('Ttree.Ress.enable.tablet') == true}
        type = 'Your.Package:TabletPage'
    }
    @cache {
        entryIdentifier {
            mobile = ${request.mobile && Configuration.setting('Ttree.Ress.enable.mobile') == true ? 'mobile' : ''}
            tablet = ${request.tablet && Configuration.setting('Ttree.Ress.enable.tablet') == true ? 'tablet' : ''}
        }
    }
}

In this example the root cache entry identifier are configured correctly for mobile and table cache. Please make sure to configure your other cache segments correctly., (*8)

Sponsors & Contributors

The development of this package is sponsored by ttree (https://ttree.ch) and techniconcept (https://techniconcept.ch)., (*9)

The Versions

20/06 2018

dev-master

9999999-dev

Ttree Responsive Web Design with Server-Side Component

  Sources   Download

MIT

The Requires

 

20/06 2018

1.0.1

1.0.1.0

Ttree Responsive Web Design with Server-Side Component

  Sources   Download

MIT

The Requires

 

01/11 2017

1.0.0

1.0.0.0

Ttree Responsive Web Design with Server-Side Component

  Sources   Download

MIT

The Requires