tx_news - Insert a slide show in detail mode

85 Views Asked by At

I would like to display a slideshow in detail mode, if the news features several pictures.

For example, previously I used tt_news, and its rgsmoothgallery extension met this need.

Do you know a simple solution for tx_news?

My system: Typo3 7.6.18 - tx_news 6.0.0

2

There are 2 best solutions below

0
On

you need to build the appropiate HTML markup in your templates.
Slideshows, lightboxes, accordions, tabs, ... need a special markup so the initializing javascript can identify all parts and rebuild the DOM. As it is about which JS-lib you use you need to know which tags are expected, which data is expected. Look in the documentation of the JS-lib.

In general you have the include of the JS-lib,
then you build your HTML,
somewhere you call something like onLoad("initSlideshow('.slideshow', options)" so that the JS can modify your DOM in all the (div?) tags which have a class 'slideshow'. Often options could be given in parameters or in data-attributes.
The rebuild of the DOM includes adding eventhandler so you can interact with the content.

As there are multiple libs and also multiple content it is easier to do this individually per installation than to build an extension which adds just one JS lib to very special content. If an extension would modify the templates of news, you can't replace the news templates easily (or you need to build the complete template where you won't need the extension at all.

0
On

To edit the detail page you need to edit the Resources/Private/Templates/News/Show.html

Here you can include your slider. To load the JavaScript file from this template you could use the vhs viewhelper v:asset.script