2017 © Pedro Peláez
 

typo3-flow-package readcounter

Package to provide a very simple mechanism to count page impressions and save them in a page property.

image

futjikato/readcounter

Package to provide a very simple mechanism to count page impressions and save them in a page property.

  • Wednesday, March 9, 2016
  • by futjikato
  • Repository
  • 2 Watchers
  • 0 Stars
  • 238 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 3 Versions
  • 0 % Grown

The README.md

Read Counter Module

Package to provide a very simple mechanism to count page impressions and save them in a page property., (*1)

Installation

After downloading check in the neos backend if this package is enabled as application or plugin., (*2)

In your main Configuration/Routes.yaml add the following snippet to activate te package:, (*3)

-
  name: 'Futjikato.ReadCounter'
  uriPattern: '<ReadCounterSubroutes>'
  subRoutes:
    'ReadCounterSubroutes':
      package: 'Futjikato.ReadCounter'

The route to call via ajax is /readcounter/tracking?node=<nodePath>., (*4)

Every page that should be countable must be extended by the Futjikato.ReadCounter:CounterMixin mixin:, (*5)

'Futjikato.DemoSite:CountedPage':
  superTypes:
    'TYPO3.Neos.NodeTypes:Page': true
    'Futjikato.ReadCounter:CounterMixin': true
  ui:
    label: 'Counted Page'

The mixin extends the page with a readcounter property you can use as a sort property or render it somewhere on the page. In addtion the mixin also adds a child node to render the tracking code., (*6)

Here an exaple typescript page configuration:, (*7)

prototype(Futjikato.DemoSite:CountedPage.Page) < prototype(Futjikato.DemoSite:Page) {
    body {
        templatePath = 'resource://Futjikato.DemoSite/Private/Templates/Page/CountedPage.html'
        parts {
            // used to render the current page read counter
            counter = ${q(documentNode).property('readcounter')}
        }
        content {
            // render a simple script tag that will track the page view
            trackingcode = Futjikato.ReadCounter:TrackingElement {
                nodePath = 'trackingcode'
            }
        }
    }
}

The Versions

09/03 2016

dev-master

9999999-dev

Package to provide a very simple mechanism to count page impressions and save them in a page property.

  Sources   Download

MIT

The Requires

 

03/02 2016

v1.0.1

1.0.1.0

Package to provide a very simple mechanism to count page impressions and save them in a page property.

  Sources   Download

MIT

The Requires

 

12/01 2016

v1.0.0

1.0.0.0

Package to provide a very simple mechanism to count page impressions and save them in a page property.

  Sources   Download

MIT

The Requires