[TYPO3-ttnews] news: realurl configuration

Sy Moen josiah.moen at gmail.com
Wed Sep 21 17:21:22 CEST 2011


That is amazing that the action / controller section works...heh, I need to
install news and write a realUrl config for it. I have not needed to use
news yet (I also still need calendar integration, and use the cal / tt_news
bridge... whatever it is called, I forget at the moment).

The way I set up realUrl for extbase extensions is like this:

in the ext_localconf.php file I include the RealURL hook call (for news as
an example):

$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/realurl/class.tx_realurl_autoconfgen.php']['extensionConfiguration']['news']
=
'EXT:news/Classes/Hook/RealUrlHook.php:&Tx_News_Hook_RealUrl->addNewsConfig';

Then, as above, I add the following file:

news/Classes/Hook/RealUrlHook.php

...which looks like this:

<?php
class Tx_News_Hook_RealUrl {

/**
 * Generates additional RealURL configuration and merges it with provided
configuration
 *
 * @param       array   $paramsDefault configuration
 * @param       tx_realurl_autoconfgen  $pObjParent object
 * @return      array   Updated configuration
 */

function addNewsConfig($params, &$pObj) {

return array_merge_recursive($params['config'], array(
                        'init' => array(
                                [...]
                        ),
                        'postVarSets' => array(
                                '_DEFAULT' => array(
                                [...]
                        )),
                        'fileName' => array(
                                'index' => array(
                                [...]
                        )),
                ));
        }
}

Then, when the config is finished, I make sure that the RealURL autoconfing
is "on" (through the Ext Manager) and delete typo3conf/realurl_autoconf.php
so that RealURL will regenerate it.

Way easier that messing with localconf.php, and it keeps all the configs
separate... easier to read.

Anyway, I will post my news setup when I test it... I need to do so in the
near future!


On Wed, Sep 21, 2011 at 7:30 AM, Jordan van Bergen <
jordanvanbergen at gmail.com> wrote:

> This is not how it should be done I assume but I have a working
> realurl configuration in /typo3conf/localconf.php that's working for
> me at the moment for the [news] extension:
>
> 'postVarSets' => array(
>        '_DEFAULT' => array(
>
>                'news' => array(
>                array(
>                                 'GETvar' =>
> 'tx_news_pi1[controller]',
>                                 'valueMap' => array(
>                                         'nieuws' => '',
>                                 ),
>                                 'noMatch' => 'bypass',
>                          ),
>                        array(
>                                 'GETvar' => 'tx_news_pi1[action]',
>                                  'valueMap' => array(
>                                         'detail' => '',
>                                 ),
>                                 'noMatch' => 'bypass',
>                         ),
>
>                        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' =>
> '-',
>                                        ),
>                                ),
>                        ),
>                 ),
>
> and after this I had some other records so make sure you close it
> accordingly with:
>
>        ),
> );
>
> or something like this at the end. I will wait for a new/better way of
> realURL inclusion in /typo3conf/localconf.php  but above solution is
> already working for me, see for example the individual links on the
> page:
>
> http://www.geefgratis.nl/over-ons/persberichten/
>
> 1 example of the realurl URL:
>
> http://www.geefgratis.nl/over-ons/persbericht/news/uitgebreide-helpdesk-stichting-geefgratis-online/
>
> Best regards,
>
> Jordan
>
> On Tue, 20 Sep 2011 09:57:38 +0200, Jordan van Bergen
> <jordanvanbergen at gmail.com> wrote:
>
> >Hi all,
> >
> >concerning the [news] extension: trying to get realurl working. I
> >looked in the different directories and found this configuration
> >example:
> >
> >$postvars = array(
> >       'news' => 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' => '-',
> >                               ),
> >                       ),
> >               ),
> >               array(
> >                       'GETvar' => 'tx_news_pi1[action]',
> >               ),
> >               array(
> >                       'GETvar' => 'tx_news_pi1[controller]',
> >               ),
> >               array(
> >                       'GETvar' => 'tx_news_pi1[year]',
> >               ),
> >               array(
> >                       'GETvar' => 'tx_news_pi1[month]',
> >               ),
> >       ),
> >
> >);
> >
> >Addes this to my realurl setup in /typo3conf/localconf.php where the
> >current tt_news realurl setup is also located but the individual news
> >items still show up like this:
> >
> >
> http://localhost.geefgratis.nl/nc/over-ons/persberichten/?tx_news_pi1%5Bcontroller%5D=News&tx_news_pi1%5Baction%5D=detail&tx_news_pi1%5Bnews%5D=50&cHash=b7d0344b2eaf9c1977577e68301b51d7
> >
> >Anyone have realurl setup in combination with news up and running and
> >wants to share how to make realurl work in the
> >/typo3conf/localconf.php configuration file or another way to make it
> >work?
> >
> >Best regards
> >Jordan
> _______________________________________________
> TYPO3-project-tt-news mailing list
> TYPO3-project-tt-news at lists.typo3.org
> http://lists.typo3.org/cgi-bin/mailman/listinfo/typo3-project-tt-news
>


More information about the TYPO3-project-tt-news mailing list