Zum Inhalt springen

Extension "news" (von Georg Ringer) und RealURL

Erstellt am 28. Februar 2013 · 3 Antworten · letzte Antwort am 28. Februar 2013

Tags: Frage

Steeeve ·

Hallo zusammen,

ich habe gerade RealURL für meine Webseite mit der eingebundenen Extension "news" (nicht tt_news) eingerichtet. Das funktioniert soweit auch.

Eine Frage habe ich bezühlich des "Datemenus" - hier werden in einem Menü alle Newseinträge nach Jahr und Monat aufgelistet:

"Januar 2013 - 2 Beiträge"
"Februar 2013 - 5 Beiträge"

usw..

RealURL gibt mir hier bei den Monaten die Ziffer aus (als z.B. für Februar "02") - Ich möchte aber gern, dass der Monat ausgeschrieben ausgegeben wird. Hat jemand einen Tipp für mich?

Ich nutze TYPO3 4.7.4

hier meiner realurl_conf.php:

<?php

$TYPO3_CONF_VARS['FE']['addRootLineFields'].= ',tx_realurl_pathsegment';
$TYPO3_CONF_VARS['EXTCONF']['realurl']['_DEFAULT'] = array(
    'pagePath' => array(
        'type' => 'user',
        'userFunc' => 'EXT:realurl/class.tx_realurl_advanced.php:&tx_realurl_advanced->main',
        'spaceCharacter' => '-',
        'expireDays' => 7,
        'rootpage_id' => 23,
        'firstHitPathCache' => 1,
        //'strtolower' => 1,
    ),
    'init' => array(
        'enableCHashCache' => 1,
        'enableCHashCache' => TRUE,
        'respectSimulateStaticURLs' => 0,
        'enableUrlDecodeCache' => 1,
        'enableUrlEncodeCache' => 1,
    ),
    'fixedPostVars' => array(
        'newsDetailConfiguration' => array(
            array(
                'GETvar' => 'tx_news_pi1[news]',
                'lookUpTable' => array(
                    'table' => 'tx_news_domain_model_news',
                    'id_field' => 'uid',
                    'alias_field' => 'title',
                    'addWhereClause' => ' AND NOT deleted',
                    'useUniqueCache' => 1,
                    'useUniqueCache_conf' => array(
                        'strtolower' => 1,
                        'spaceCharacter' => '-',
                    )
                )
            )
        ),
        '64' => 'newsDetailConfiguration'
    ),
    'postVarSets' => array(
        '_DEFAULT' => array(
            'controller' => array(
                array(
                    'GETvar' => 'tx_news_pi1[action]',
                    'noMatch' => 'bypass',
                ),
                array(
                    'GETvar' => 'tx_news_pi1[controller]',
                    'noMatch' => 'bypass',
                ),  
            ),
            'tags' => array(
                array(
                    'GETvar' => 'tx_news_pi1[overwriteDemand][tags]',
                    'lookUpTable' => array (
                      'tabele' => 'tx_news_domain_model_tag',
                      'id_field' => 'uid',
                      'alias_field' => 'title',
                      'addWhereClause' => 'AND NOT deleted',
                      'useUniqueCache' => 1,
                      'useUniqueCache_conf' => array (
                        'strtolower' => 1,
                        'spaceCharacter' => '-',
                        ),
                    ),
                ),
            ),
            // news archive parameters
            'archiv' => array(
                array(
                    'GETvar' => 'tx_news_pi1[overwriteDemand][year]',
                ),
                array(
                    'GETvar' => 'tx_news_pi1[overwriteDemand][month]',
                ),
            ),
        ),
    ),
    // configure filenames for different pagetypes
    'fileName' => array(
        'defaultToHTMLsuffixOnPrev' => 1,
    ),
);
?>

das zugehörige TypoScript:

### RealURL ###
###############
    
simulateStaticDocuments = 0
baseURL = http://localhost/heikos-blog/
tx_realurl_enable = 1
prefixLocalAnchors = all

und die .htaccess:

RewriteEngine On
RewriteRule	^typo3$ - [L]
RewriteRule	^typo3/.*$ - [L]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-l
RewriteRule   .* index.php

Vielen Dank vorab!

Gruß
Heiko

Steeeve ·

verdammt.. geschrieben und gelöst:

<?php

$TYPO3_CONF_VARS['FE']['addRootLineFields'].= ',tx_realurl_pathsegment';
$TYPO3_CONF_VARS['EXTCONF']['realurl']['_DEFAULT'] = array(
    'pagePath' => array(
        'type' => 'user',
        'userFunc' => 'EXT:realurl/class.tx_realurl_advanced.php:&tx_realurl_advanced->main',
        'spaceCharacter' => '-',
        'expireDays' => 7,
        'rootpage_id' => 23,
        'firstHitPathCache' => 1,
        //'strtolower' => 1,
    ),
    'init' => array(
        'enableCHashCache' => 1,
        'enableCHashCache' => TRUE,
        'respectSimulateStaticURLs' => 0,
        'enableUrlDecodeCache' => 1,
        'enableUrlEncodeCache' => 1,
    ),
    'fixedPostVars' => array(
        'newsDetailConfiguration' => array(
            array(
                'GETvar' => 'tx_news_pi1[news]',
                'lookUpTable' => array(
                    'table' => 'tx_news_domain_model_news',
                    'id_field' => 'uid',
                    'alias_field' => 'title',
                    'addWhereClause' => ' AND NOT deleted',
                    'useUniqueCache' => 1,
                    'useUniqueCache_conf' => array(
                        'strtolower' => 1,
                        'spaceCharacter' => '-',
                    )
                )
            )
        ),
        '64' => 'newsDetailConfiguration'
    ),
    'postVarSets' => array(
        '_DEFAULT' => array(
            'controller' => array(
                array(
                    'GETvar' => 'tx_news_pi1[action]',
                    'noMatch' => 'bypass',
                ),
                array(
                    'GETvar' => 'tx_news_pi1[controller]',
                    'noMatch' => 'bypass',
                ),  
            ),
            'tags' => array(
                array(
                    'GETvar' => 'tx_news_pi1[overwriteDemand][tags]',
                    'lookUpTable' => array (
                      'tabele' => 'tx_news_domain_model_tag',
                      'id_field' => 'uid',
                      'alias_field' => 'title',
                      'addWhereClause' => 'AND NOT deleted',
                      'useUniqueCache' => 1,
                      'useUniqueCache_conf' => array (
                        'strtolower' => 1,
                        'spaceCharacter' => '-',
                        ),
                    ),
                ),
            ),
            // news archive parameters
            'archiv' => array(
                array(
                    'GETvar' => 'tx_news_pi1[overwriteDemand][year]',
                ),
                array(
                    'GETvar' => 'tx_news_pi1[overwriteDemand][month]',
                    'valueMap' => array(
                        'january' => '01',
                        'february' => '02',
                        'march' => '03',
                        'april' => '04',
                        'may' => '05',
                        'june' => '06',
                        'july' => '07',
                        'august' => '08',
                        'september' => '09',
                        'october' => '10',
                        'november' => '11',
                        'december' => '12',
                    ),
                ),
            ),
        ),
    ),
    // configure filenames for different pagetypes
    'fileName' => array(
        'defaultToHTMLsuffixOnPrev' => 1,
    ),
);
?>

Danke & Gruß
Heiko

Steeeve ·

Hallo nochmal,

im gleichen Zusammenhang noch eine Frage - bei gleichen Einstellungen wie oben.

Die verlinkten Tags in jeder News werden auch nach dem folgenden Format ausgegeben:

"http://localhost/heikos-blog/neuigkeiten/tags/15.html"

ich hätte aber gern anstatt der uid des Tags den title. Hier kann ich ja keine valuemap machen.

scheinbar funktioniert das alias_field nicht?

'tags' => array(
                array(
                    'GETvar' => 'tx_news_pi1[overwriteDemand][tags]',
                    'lookUpTable' => array (
                      'tabele' => 'tx_news_domain_model_tag',
                      'id_field' => 'uid',
                      'alias_field' => 'title',
                      'addWhereClause' => 'AND NOT deleted',
                      'useUniqueCache' => 1,
                      'useUniqueCache_conf' => array (
                        'strtolower' => 1,
                        'spaceCharacter' => '-',
                        ),
                    ),
                ),
            ),

Hat jemand eine Idee?

Gruß
Heiko