[TYPO3-UG Italy] Risolto: Grazie Mauro la tua soluzione ha funzionato.

Nicola Cerchiari nicola.cerchiari at gmail.com
Wed Oct 5 17:38:27 CEST 2011


Ciao Ernesto,
credo che Mauro ti avesse già suggerito questa strada ma te la ripropongo in
quanto per me funziona sempre.
Nel plugin che vuoi che sia ambivalente (SINGLE/LATEST) non impostare dal
menu a tendina la visualizzazione del plugin, quindi SINGLE o LATEST o
LIST... settalo però per visualizzare una sola news in LIST e LATEST (puoi
farlo comunque da typoscript)

Crea invece un template ext dove inserisci un typoscript simile:

[globalVar = GP:tx_ttnews|tt_news > 0]
*
*
plugin.tt_news.code = SINGLE
[else]
*
*plugin.tt_news.code = LATEST

[global]

A questo punto non ti resta che modificare iltemplate html LATEST in modo
che sia uguale al SINGLE ed il gioco è fatto poichè automaticamente se
chiami la pagina senza specificare un id news il plugin verrà impostato come
LATEST mostrando soltanto l'ultima news inserita. Se invece chiami la pagina
con un id news (ad esempio da un altro plugin LIST o LATEST) questo ti
mostrerà la news scelta.

Facci sapere se fa al caso tuo.

Saluti
Nicola

In questo modo automaticamente
Il giorno 05 ottobre 2011 17:11, <esetti at interfree.it> ha scritto:

> Se fosse possibile disporre di un soluzione che consenta di scegliere
> AUTOMATICAMENTE l'ultima news (invece di impostarla a mano), sarebbe molto
> comodo.
>
> Il codice riportato nel manuale tt_news non sono riuscito a farlo
> funzionare.
>
> # hide the "no news id" message
> plugin.tt_news._LOCAL_LANG.**default.noNewsIdMsg = &nbsp;
> # set the tt_news singlePid to the current page
> plugin.tt_news.singlePid = 977
> # fill the content of the main-column to a tmp.object
> tmp.pagecontent < page.10.subparts.contentarea
> # clear the content of the main column
> page.10.subparts.contentarea >
> # build a new object for this column as content-object-array
> page.10.subparts.contentarea = COA
> page.10.subparts.contentarea {
>   10 = CONTENT
>   10.table = tt_news
>   10.select {
>       # insert the pids of all pages from where you want to fetch news.
>       # the recursive-field has no influence on this selection
>       pidInList = 1078,1079,1080,1081,1082,1083,**1084
>       orderBy = datetime desc
>       max = 1
>   }
>   # insert the object “10.” only if there is no SINGLE news selected
>   10.stdWrap.if.isFalse.data = GPvar:tx_ttnews|tt_news
>   # re-insert the normal pagecontent to the page
>   20 < tmp.pagecontent
> }
>
>
>
> "Mauro Lorenzutti" <mauro.lorenzutti at webformat.**com<mauro.lorenzutti at webformat.com>>
> ha scritto nel messaggio news:mailman.1.1317478373.**
> 17360.typo3-ug-italy at lists.**typo3.org...
>
>> Salve Ernesto,
>>
>> potresti settare un id di default mediante le _DEFAULT_PI_VARS:
>>
>> plugin.tt_news._DEFAULT_PI_**VARS.tt_news = 123
>> dove 123 è l'uid della news che vuoi venga mostrata nel caso non sia stata
>> selezionata passata news in get
>>
>> Ciao,
>> Mauro
>>
>>
>> Il 30/09/2011 14:57, esetti at interfree.it ha scritto:
>>
>>> Buongiorno Mauro.
>>>
>>> Purtroppo la tt-news in oggetto deve servire anche a visualizzare le
>>> news selezionate da un'altra tt_news, quindi deve restare un componente
>>> SINGLE. Quello che desidero è che, al caricamento della pagina, quando
>>> nessuna news è ancora stata selezionata, la tt_news carichi di default
>>> la notizia più recente (o al limite un'altra notizia predefinita) ed
>>> eviti l'antipatico messaggio "no news_id given".
>>>
>>> Grazie per il benvenuto.
>>> Ernesto
>>>
>>> "Mauro Lorenzutti" <mauro.lorenzutti at webformat.**com<mauro.lorenzutti at webformat.com>>
>>> ha scritto nel
>>> messaggio news:mailman.1.1317386769.**12185.typo3-ug-italy at lists.**
>>> typo3.org...
>>>
>>>> Salve Ernesto,
>>>>
>>>> benvenuto nel club di TYPO3 ;-)
>>>>
>>>
>>>
>>
>> --
>> Mauro Lorenzutti
>>
>> CTO / Software Architect
>> mauro.lorenzutti at webformat.com
>> Tel.   +39-0427-926.389
>>
>> WEBFORMAT srl – www.webformat.com
>> Via S. Francesco d'Assisi, 6 – 20122 MILANO
>> Corte Europa, 12 - 33097 SPILIMBERGO (PN)
>>
>> TYPO3 Certified Integrator
>>
>>
> ______________________________**_________________
> TYPO3-UG-Italy mailing list
> TYPO3-UG-Italy at lists.typo3.org
> http://lists.typo3.org/cgi-**bin/mailman/listinfo/typo3-ug-**italy<http://lists.typo3.org/cgi-bin/mailman/listinfo/typo3-ug-italy>
>


More information about the TYPO3-UG-Italy mailing list