[TYPO3-english] R: RealURL: news ID + title in the URL

De Contardi Riccardo Riccardo.DeContardi at bhuman.it
Mon Nov 22 17:21:25 CET 2010


I use this:

array(
	'GETvar' => 'tx_ttnews[tt_news]',
	'lookUpTable' => array(
		'table' => 'tt_news',
		'id_field' => 'uid',									
		'alias_field' => 'concat(title," ",uid)',
		'addWhereClause' => ' AND deleted != 1',
		'useUniqueCache' => 1,
		'useUniqueCache_conf' => array(
		'strtolower' => 1,
		'spaceCharacter' => '-'
		)
	)
),

to obtain "news-title-1244"

regards
--------------------------------------------
Riccardo De Contardi - Web Developer
B Human Srl - www.bhuman.it
Via Canzio, 15 - 20131 Milano
TEL +39-02-20.23.271 - FAX +39-02-20.240.561
--------------------------------------------

-----Messaggio originale-----
Da: typo3-english-bounces at lists.typo3.org [mailto:typo3-english-bounces at lists.typo3.org] Per conto di Andy Pattynama
Inviato: lunedì 22 novembre 2010 15:55
A: TYPO3 English
Oggetto: [TYPO3-english] RealURL: news ID + title in the URL

Hi there

I would like to achieve following URL for a tt_news single-view:
http://www.mysite.com/news-category/article/news-id/news-title/

The news-id & the news-title should be visible in the URL. My postVarsSet looks like this at the moment:

                        'artikel' => array(

                                array (
                                        'GETvar' => 'tx_ttnews[tt_news]',
                                        'lookUpTable' => array (
                                                'table' => 'tt_news',
                                                'id_field' => 'uid',
                                                'alias_field' => 'title',
                                                'addWhereClause'=> 'AND NOT deleted',
                                                'useUniqueCache'=> 1,
                                                'useUniqueCache_conf' => array (
                                                        'strtolower' => 1,
                                                        'spaceCharacter' => '-',
                                                ),
                                        ),
                                ),

                        ),

I also tried the following:
 'artikel' => array(
                               array (
                                        'GETvar' => 'tx_ttnews[tt_news]',
                                        'lookUpTable' => array (
                                                'table' => 'tt_news',
                                                'id_field' => 'uid',
                                                'alias_field' => 'uid',
                                                'addWhereClause'=> 'AND NOT deleted',
                                                'useUniqueCache'=> 1,
                                                'useUniqueCache_conf' => array (
                                                        'strtolower' => 1,
                                                        'spaceCharacter' => '-',
                                                ),
                                        ),
                                ),
                                array (
                                        'GETvar' => 'tx_ttnews[tt_news]',
                                        'lookUpTable' => array (
                                                'table' => 'tt_news',
                                                'id_field' => 'uid',
                                                'alias_field' => 'title',
                                                'addWhereClause'=> 'AND NOT deleted',
                                                'useUniqueCache'=> 1,
                                                'useUniqueCache_conf' => array (
                                                        'strtolower' => 1,
                                                        'spaceCharacter' => '-',
                                                ),
                                        ),
                                ),

                        ),
but that didn't work.

It looks like that once the GETvar 'tx_ttnews[tt_news]' has been 'used', it's not possible to use it again. Is there maybe another workaround to achieve the URLs?

Thanks in advance.

Best regards,
Andy
_______________________________________________
TYPO3-english mailing list
TYPO3-english at lists.typo3.org
http://lists.typo3.org/cgi-bin/mailman/listinfo/typo3-english

**************************************************

Chi riceve il presente messaggio e' tenuto a verificare se lo stesso non gli sia pervenuto per errore. In tal caso e' pregato di avvisare immediatamente il mittente e, tenuto conto delle responsabilita connesse all'indebito utilizzo e/o divulgazione del messaggio e/o delle informazioni in esso contenute, voglia cancellare l'originale e distruggere le varie copie o stampe.

The receiver of this message is required to check if he/she has received it erroneously. If so, the receiver is requested to immediately inform the sender and - in consideration of the responsibilities arising from undue use and/or disclosure of the message and/or the information contained therein - destroy the original message and any copy or printout thereof.




More information about the TYPO3-english mailing list