Browse Source

RSS news add anchor

Branche10.4
Fred Tempez 1 year ago
parent
commit
30c3196460
  1. 4
      module/news/news.php
  2. 2
      module/news/view/index/index.php

4
module/news/news.php

@ -70,11 +70,11 @@ class news extends common {
$author = $this->signature($this->getData(['module', $this->getUrl(0), 'posts', $newsId, 'userId']));
$newsArticle->addElementArray([
'title' => $this->getData(['module', $this->getUrl(0),'posts', $newsId, 'title']),
'link' => helper::baseUrl() . $this->getUrl(0),
'link' => helper::baseUrl() . $this->getUrl(0) . '/' . $newsId . '#' . $newsId,
'description' => $this->getData(['module', $this->getUrl(0),'posts', $newsId, 'content'])
]);
$newsArticle->setAuthor($author,'no@mail.com');
$newsArticle->setId(helper::baseUrl() .$this->getUrl(0) . '/' . $newsId);
$newsArticle->setId(helper::baseUrl() .$this->getUrl(0) . '/' . $newsId . '#' . $newsId);
$newsArticle->setDate(date('r', $this->getData(['module', $this->getUrl(0), 'posts', $newsId, 'publishedOn'])));
$feeds->addItem($newsArticle);
}

2
module/news/view/index/index.php

@ -2,7 +2,7 @@
<div class="row">
<div class="col12">
<?php foreach($module::$news as $newsId => $news): ?>
<h1 class="newsTitle">
<h1 class="newsTitle" id="<?php echo $newsId;?>">
<?php echo $news['title']; ?>
</h1>
<div class="newsContent">

Loading…
Cancel
Save