简体   繁体   中英

TYPO3 tt_news - show hidden news

on TYPO3 with the tt_news extension, my contributors would like to previews news before publishing ; Problem : impossible to get a preview if the news is hidden. Our website is big and we can't display the news before to finish it, even for preview for a few seconds.

According to this documentation :

If a preview of hidden records needs to be allowed too, the checkbox “Allow hidden records” needs to be checked in the plugin.

No way to find this checkbox. Do you have any solution ?

According to the tt_news documentation , you have to set the following Page TSconfig :

tx_ttnews.singlePid = 37

where 37 is the UID of the page containing the single view plugin.

Apparently this functionality is currently broken:

The second issue on forge.typo3.org provides a possible solution which should work in general with all records of any extension (TYPO3 v7 and above!). Again, Page TSconfig (no TypoScript):

TCEMAIN.preview {
    tt_news {
        previewPageId = 37
        useDefaultLanguageRecord = 0
        fieldToParameterMap {
            uid = tx_ttnews[tt_news]
        }
    }
}

I successfully tested this in TYPO3 v7. One major drawback – as already noted in your question – is that this does not work with hidden records.

Previewing hidden records result in the error message

no news_id given

Edit: As Bernd suggested, you could make use of categories to hide drafts of news records and use the preview solution above:

  1. If you already use news categories: Set the category mode in the list view plugin(s) of tt_news to hide news records which do not own the desired categories. Let the editors assign the categories only if the content is ready.
  2. Otherwise: use a new category preview – as Bernd suggested – and hide records with this category in the list view plugin.

The latter is a bit more risky to use for editors, as they could forget to set this temporary category. Nonetheless, you as an integrator could use the TSconfig TCAdefaults to automatically assign this preview category to all new records. The editors would only have to remove the category when the news record is completed.

Another possible workaround could be to save drafts in a separate folder which is not used by the list view plugin of tt_news. Then you also could use the preview solution above.


If that's not the right way of working for you or your editors, you could try using the workspaces extension which ships with the TYPO3 core.

a clean solution would be the usage of workspaces. but not all extension support it.

so another option would be to simulate workspaces:
build a page where your news can be seen and secure it with a login. so if only the new records should be shown you might create a 'preview' category, which is shown only on the special preview page.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM