Rheinschafe / TYPO3-Extension-rs_etracker

Other
0 stars 1 forks source link

[FEATURE] Use Rootline for et_pagename #2

Open bippesbrandao opened 8 years ago

bippesbrandao commented 8 years ago

Hi,

thanks for your work. We added a little additional setting which extends the pagename with the complete rootline. The reason to do it is to better be able to filter within the eTracker Backend for certain pages or areas. e.g. et_pagename = Home/b2b/services instead of: e.g. et_pagename = services

Here is how we have done it, it is turned on by setting "plugin.tx_rsetracker.settings.pageNameRootline = 1"

    // page name
    if (!empty($this->settings['pageName'])) {
        $pageName = $this->settings['pageName'];
    } else {
        $pageName = !empty($this->getTyposcriptFrontendController()->altPageTitle) ? $this->getTyposcriptFrontendController()->altPageTitle : $this->getTyposcriptFrontendController()->page['title'];
    }
    /** START: Patch BB */
    if (!empty($this->settings['pageNameRootline'])) {
        $rootline = array();
        foreach ($this->getTyposcriptFrontendController()->rootLine as $page) {
            array_unshift($rootline,$page['title']);
        }
        // Remove last Element as it is the current page
        $pageName = implode('/',array_slice($rootline,0,-1)) . '/' . $pageName;
    }
    /** END */

...

higidi commented 8 years ago

Hi,

nice Feature. Will be implemented in v1.1.0.

Regards, Daniel