RSS news add anchor
This commit is contained in:
parent
d20bd6d14f
commit
30c3196460
@ -70,11 +70,11 @@ class news extends common {
|
|||||||
$author = $this->signature($this->getData(['module', $this->getUrl(0), 'posts', $newsId, 'userId']));
|
$author = $this->signature($this->getData(['module', $this->getUrl(0), 'posts', $newsId, 'userId']));
|
||||||
$newsArticle->addElementArray([
|
$newsArticle->addElementArray([
|
||||||
'title' => $this->getData(['module', $this->getUrl(0),'posts', $newsId, 'title']),
|
'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'])
|
'description' => $this->getData(['module', $this->getUrl(0),'posts', $newsId, 'content'])
|
||||||
]);
|
]);
|
||||||
$newsArticle->setAuthor($author,'no@mail.com');
|
$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'])));
|
$newsArticle->setDate(date('r', $this->getData(['module', $this->getUrl(0), 'posts', $newsId, 'publishedOn'])));
|
||||||
$feeds->addItem($newsArticle);
|
$feeds->addItem($newsArticle);
|
||||||
}
|
}
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col12">
|
<div class="col12">
|
||||||
<?php foreach($module::$news as $newsId => $news): ?>
|
<?php foreach($module::$news as $newsId => $news): ?>
|
||||||
<h1 class="newsTitle">
|
<h1 class="newsTitle" id="<?php echo $newsId;?>">
|
||||||
<?php echo $news['title']; ?>
|
<?php echo $news['title']; ?>
|
||||||
</h1>
|
</h1>
|
||||||
<div class="newsContent">
|
<div class="newsContent">
|
||||||
|
Loading…
Reference in New Issue
Block a user