Skip to content

Commit

Permalink
Added basic table structure for sitemap urls
Browse files Browse the repository at this point in the history
  • Loading branch information
kimsondrup committed Jul 9, 2018
1 parent ac129ab commit d47751f
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 4 deletions.
5 changes: 4 additions & 1 deletion src/Block/Sitemap.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,10 @@ public function sitemapUrls(): array
foreach ($this->_storeRepository->getList() as $store) {
$storeId = (int)$store->getId();
if ($this->_sitemapGenerator->isSitemapGenerated($storeId)) {
$sitemapUrls[$storeId] = $this->_sitemapGenerator->getSitemapUrl($storeId);
$sitemapUrls[$storeId] = [
'label' => $store->getName(),
'url' => $this->_sitemapGenerator->getSitemapUrl($storeId),
];
}
}
return $sitemapUrls;
Expand Down
15 changes: 12 additions & 3 deletions src/view/adminhtml/templates/sitemap.phtml
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
<?php /** @var \Siteimprove\Magento\Block\Sitemap $block */ ?>
<table style="width:100%">
<tr style="text-align: left">
<th><?php echo __('Store name') ?></th>
<th><?php echo __('Sitemap url') ?></th>
</tr>
<?php foreach ($block->sitemapUrls() as $sitemap): ?>
<tr>
<td><?php echo $block->escapeHtml($sitemap['label']); ?></td>
<td><?php echo $block->escapeHtml($sitemap['url']); ?></td>
</tr>
<?php endforeach; ?>
</table>

<?php foreach ($block->sitemapUrls() as $url): ?>
<?php echo $block->escapeHtml($url); ?> <br>
<?php endforeach; ?>

0 comments on commit d47751f

Please sign in to comment.