Skip to content

Extend the breadcrumb

Benjamin Kott edited this page Sep 23, 2021 · 1 revision

User Function Function

[SOME CONDITION]
page {
    10 {
        variables {
            breadcrumbExtendedValue = COA
            breadcrumbExtendedValue {
                10 = USER
                10 {
                    userFunc = Vendor\Package\UserFunc\TypoScriptUserFunc->breadrumbValue
                }
            }
        }
    }
}
[end]
<?php declare(strict_types=1);

namespace Vendor\Package\UserFunc;

class TypoScriptUserFunc
{
    /**
     * @param string
     * @param array
     * @return string
     */
    public function breadrumbValue(string $content, array $conf): string
    {
        $queryParams = $GLOBALS['TYPO3_REQUEST']->getQueryParams() ?? [];
        if (!isset($queryParams['tx_package_show']['documentId'])) {
            return '';
        }

        // @TODO RESOLVE VALUE
        $value = $queryParams['tx_package_show']['documentId'];

        return $value;
    }
}

Remove "Show" Page from Breadcrumb

Home \ Module \ Show \ ACTIVE VALUE
Home \ Module \ ACTIVE VALUE
[SOME CONDITION]
page {
    10 {
        dataProcessing {
            30 {
                special.range = 0|-2
            }
        }
    }
}
[end]