Skip to content
Snippets Groups Projects
Commit c0edefb1 authored by Torsten Oppermann's avatar Torsten Oppermann
Browse files

[TASK] Rendering the news

parent 10ec485d
No related branches found
No related tags found
1 merge request!2Feature be module
......@@ -43,11 +43,12 @@ class NewsRepository extends AbstractRepository {
* @param int $offset
* @param string $sortBy date or positionInTree
* @param array $tagIds NULL, if the tag filter isn't applied, otherwise an array with the tag uids.
* @return QueryResultInterface
* @param boolean $raw execute raw parameter
* @return QueryResultInterface | array
* @throws \TYPO3\CMS\Extbase\Persistence\Exception\InvalidQueryException
*/
public function findAllSortedNewsByCategories(
array $categoryIds = NULL, $limit = 0, $offset = 0, $sortBy = 'date', array $tagIds = NULL
array $categoryIds = NULL, $limit = 0, $offset = 0, $sortBy = 'date', array $tagIds = NULL, $raw = FALSE
) {
$query = $this->createQuery();
......@@ -99,7 +100,7 @@ class NewsRepository extends AbstractRepository {
);
}
return $query->execute();
return $query->execute($raw);
}
/**
......
......@@ -140,6 +140,6 @@ class Utility {
$objectManager = GeneralUtility::makeInstance(ObjectManager::class);
/** @var NewsRepository $newsRepository */
$newsRepository = $objectManager->get(NewsRepository::class);
return $newsRepository->findAllSortedNewsByCategories($categories)->toArray();
return $newsRepository->findAllSortedNewsByCategories($categories, 0, 0, 'date', NULL, $raw = TRUE);
}
}
......@@ -12,4 +12,43 @@
<f:translate key="backend.message" />
</p>
<f:if condition="{news}">
<div class="panel panel-default recordlist">
<div class="table-fit">
<table data-table="pages" class="table table-striped table-hover">
<sg:backend.widget.paginate objects="{news}" as="paginatedNews" configuration="{insertAbove: 1, itemsPerPage: 20}">
<tbody>
<f:for each="{paginatedNews}" as="singleNews">
{sg:backend.editOnClick(table: 'pages', uid: singleNews.uid) -> sg:set(name: 'editOnClick')}
<tr data-uid="{singleNews.uid}">
<td nowrap="nowrap" class="col-icon">
<f:format.raw>
<sg:backend.icon table="pages" row="{singleNews}" />
</f:format.raw>
</td>
<td nowrap="nowrap">
<a href="#" onclick="{editOnClick}">
<span>
<f:if condition="{singleNews.title}">
<f:then>
{singleNews.title}
</f:then>
</f:if>
</span>
</a>
</td>
<td nowrap="nowrap" class="col-control">
<f:format.raw>
<sg:backend.control table="tx_sgroutes_domain_model_page" row="{singleNews}" />
</f:format.raw>
</td>
</tr>
</f:for>
</tbody>
</sg:backend.widget.paginate>
</table>
</div>
</div>
</f:if>
</f:section>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment