[Frage] Pfad anpassen der Newsbeiträge (realURL) TYPO3-Version: 8.7.17

  • lmwa_3 lmwa_3
    Jar Jar Binks
    0 x
    1 Beiträge
    0 Hilfreiche Beiträge
    18. 11. 2019, 16:35

    Ich versuche gerade die Url der News-Beiträge anzupassen.

    Die Kategorie übergebe ich mit:
    [code]<n:link newsItem="{newsItem}" settings="{settings}" title="{newsItem.title}" class="read_more" configuration="{additionalParams:'&tx_news_pi1[category]={newsItem.firstCategory.uid}'}">
    <span class=fg-color4>&gt;&gt;</span>&nbsp;<f:translate key="LLL:EXT:t3dg_distribution/Resources/Private/Language/Frontend.xlf:news.read-more"/>
    </n:link>[/code]

    und mit folgender realurl_conf.php wollte ich es eigentlich schaffen, das die url wie folgt lautet:

    https://webseite.de/kategoriename/blogbeitragsname/

    Allerdings lautet er aktuell noch so:

    https://webseite.de/blog-detail/kategoriename/blogbeitragsname/

    Ich habe versucht mit user_encodeSpURL_postProc(...) das "blog-detail" zu entfernen, aber dann funktioniert die gleichnamige Seite "kategoriename" nicht mehr.

    Eine extra Seite wollte ich allerdings nicht für jeden Blog anlegen.

    Hat jemand ein Tipp ? Lieben Dank

    [code]<?php
    $GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['realurl'] = [
    //'encodeSpURL_postProc' => array('user_encodeSpURL_postProc'),
    //'decodeSpURL_preProc' => array('user_decodeSpURL_preProc'),
    '_DEFAULT' => [
    'init' => [
    'enableCHashCache' => TRUE,
    'enableCHashCache' => 1,
    'respectSimulateStaticURLs' => 0,
    'enableUrlDecodeCache' => 1,
    'enableUrlEncodeCache' => 1,
    'appendMissingSlash' => 'ifNotFile,redirect'
    ],
    'pagePath' => [
    'type' => 'user',
    'userFunc' => 'EXT:realurl/class.tx_realurl_advanced.php:&tx_realurl_advanced->main',
    'spaceCharacter' => '-',
    'languageGetVar' => 'L',
    'expireDays' => '7',
    'rootpage_id' => 1,
    'firstHitPathCache' => 1
    ],
    'fileName' => [
    'defaultToHTMLsuffixOnPrev' => 0,
    'acceptHTMLsuffix' => 0,
    'defaultToXMLsuffixOnPrev' => 0,
    'index' => [
    'print' => [
    'keyValues' => [
    'type' => 98
    ]
    ],
    'rss.xml' => [
    'keyValues' => [
    'type' => 100,
    ],
    ],
    'rdf.xml' => [
    'keyValues' => [
    'type' => 102,
    ],
    ],
    'atom.xml' => [
    'keyValues' => [
    'type' => 103,
    ],
    ],
    'sitemap.xml' => [
    'keyValues' => [
    'type' => 1522073831
    ]
    ],
    'sitemap-pages.xml' => [
    'keyValues' => [
    'type' => 1522073831,
    'tx_yoastseo_sitemap' => 'pages'
    ]
    ]
    ]
    ],
    'preVars' => [
    [
    'GETvar' => 'no_cache',
    'valueMap' => [
    'nc' => 1
    ],
    'noMatch' => 'bypass'
    ],
    [
    'GETvar' => 'L',
    'valueMap' => [
    'en' => '1'
    ],
    'noMatch' => 'bypass'
    ]
    ],
    'fixedPostVars' => [
    'newsDetailConfiguration' => [
    [
    'GETvar' => 'tx_news_pi1[action]',
    'valueMap' => [
    '' => 'detail',
    ],
    'noMatch' => 'bypass'
    ],
    [
    'GETvar' => 'tx_news_pi1[controller]',
    'valueMap' => [
    '' => 'detail',
    ],
    'noMatch' => 'bypass'
    ],
    [
    'GETvar' => 'tx_news_pi1[category]',
    'lookUpTable' => [
    'table' => 'sys_category',
    'id_field' => 'uid',
    'alias_field' => 'title',
    'addWhereClause' => ' AND NOT deleted',
    'useUniqueCache' => 1,
    'enable404forInvalidAlias' => true
    ],
    ],
    [
    'GETvar' => 'tx_news_pi1[news]',
    'lookUpTable' => [
    'table' => 'tx_news_domain_model_news',
    'id_field' => 'uid',
    'alias_field' => 'IF(path_segment!="",path_segment,title)',
    'addWhereClause' => ' AND NOT deleted',
    'useUniqueCache' => 1,
    'useUniqueCache_conf' => [
    'strtolower' => 1,
    'spaceCharacter' => '-'
    ],
    'languageGetVar' => 'L',
    'languageExceptionUids' => '',
    'languageField' => 'sys_language_uid',
    'transOrigPointerField' => 'l10n_parent',
    'autoUpdate' => 1,
    'expireDays' => 180,
    'enable404forInvalidAlias' => true
    ]
    ]
    ],
    'newsCategoryConfiguration' => [
    [
    'GETvar' => 'tx_news_pi1[overwriteDemand][categories]',
    'lookUpTable' => [
    'table' => 'sys_category',
    'id_field' => 'uid',
    'alias_field' => 'title',
    'addWhereClause' => ' AND NOT deleted',
    'useUniqueCache' => 1,
    'enable404forInvalidAlias' => true
    ]
    ]
    ],
    'newsTagConfiguration' => [
    [
    'GETvar' => 'tx_news_pi1[overwriteDemand][tags]',
    'lookUpTable' => [
    'table' => 'tx_news_domain_model_tag',
    'id_field' => 'uid',
    'alias_field' => 'title',
    'addWhereClause' => ' AND NOT deleted',
    'useUniqueCache' => 1,
    'enable404forInvalidAlias' => true
    ]
    ]
    ],
    '56' => 'newsDetailConfiguration',
    '55' => 'newsTagConfiguration',
    '55' => 'newsCategoryConfiguration',
    ],
    'postVarSets' => [
    '_DEFAULT' => [
    'controller' => [
    [
    'GETvar' => 'tx_news_pi1[action]',
    'noMatch' => 'bypass'
    ],
    [
    'GETvar' => 'tx_news_pi1[controller]',
    'noMatch' => 'bypass'
    ],
    [
    'GETvar' => 'tx_t3lmwamediagallery_listcategoryfilteredmedia[action]',
    'noMatch' => 'bypass'
    ],
    [
    'GETvar' => 'tx_t3lmwamediagallery_listcategoryfilteredmedia[controller]',
    'noMatch' => 'bypass'
    ],
    ],
    'dateFilter' => [
    [
    'GETvar' => 'tx_news_pi1[overwriteDemand][year]',
    ],
    [
    'GETvar' => 'tx_news_pi1[overwriteDemand][month]',
    ],
    ],
    'page' => [
    [
    'GETvar' => 'tx_news_pi1[@widget_0][currentPage]',
    ],
    ],
    ],
    ],
    ]
    ];
    /*
    function user_decodeSpURL_preProc(&$params, &$ref) {
    // e.g. blog-detail/fahrwerke/fahrwerke-beitrag1/
    $params['URL'] = str_replace('fahrwerke/', 'blog-detail/fahrwerke/', $params['URL']);
    }

    function user_encodeSpURL_postProc(&$params, &$ref) {
    $params['URL'] = str_replace('blog-detail/fahrwerke/', 'fahrwerke/', $params['URL']);
    }*/
    [/code]


  • 1
  • Julian.Hofmann Julian.Ho...
    Flash Gordon
    0 x
    2886 Beiträge
    107 Hilfreiche Beiträge
    19. 11. 2019, 10:25

    Der Detaillink geht auf die Seite 56?

    Hast Du RealURL-Caches (ggf. RealURL-Tabellen) geleert?

    Nebenbei:
    für die Seite 55 können nicht newsTagConfiguration *und* newsCategoryConfiguration greifen. Die Konfiguration ist ein Array, bei dem an dieser Stelle die Seiten-IDs die Keys sind. Du weißt demselben Key aber zwei unterschiedliche Werte zu.

  • 1