如何在typo3中以详细视图显示所有新闻?

时间:2015-08-26 11:13:48

标签: typo3 typoscript typo3-7.x

我按照this教程在typo3中创建新闻页面。但我想在同一页面的侧栏和详细视图中显示所有新闻。当我尝试在同一页面上创建带有详细视图的插件元素时,它会显示错误

QFileInfo fileInfo(uploadFilePath);

QVariantMap InfoJSON;
InfoJSON.insert("FileTypeRecId", filetypeid);
InfoJSON.insert("CreatedUpdatedBy", "nm");
InfoJSON.insert("actualFileName", fileInfo.fileName());
QJsonDocument doc= QJsonDocument::fromVariant(InfoJSON);

QHttpPart infoPart;
infoPart.setHeader(QNetworkRequest::ContentDispositionHeader, QVariant("form-data; name=\"ObjectInfo\""));
infoPart.setBody(doc.toJson());

QHttpPart filePart;
filePart.setHeader(QNetworkRequest::ContentDispositionHeader, QVariant("form-data; name=\""+ fileInfo.baseName() + "\"; filename=\""+ fileInfo.fileName() + "\""));
QFile *file = new QFile(uploadFilePath);
file->open(QIODevice::ReadOnly);
filePart.setBodyDevice(file);

file->setParent(multiPart);

QHttpMultiPart *multiPart = new QHttpMultiPart(QHttpMultiPart::FormDataType);
multiPart->append(infoPart);
multiPart->append(filePart);

Screenshot of page

我已指向

的同一页面
Reason: No news entry found.

代表PageId for single news display

如果新闻内容超过10,如何执行此操作以及如何启用list view(Without overloadin detail view)next page

1 个答案:

答案 0 :(得分:0)

您应该使用此案例的新闻文档 List and detail on the same page using TypoScript。 重要的是条件。

[globalVar = GP:tx_news_pi1|news > 0]
  page.10.marks.content < lib.news_detail
[else]
  page.10.marks.content < lib.news_list
[end]