Commit f7efa3db authored by Richard Mansfield's avatar Richard Mansfield
Browse files

Link blog, blogpost titles to the artefact view when rendering

parent ff7ca5c1
......@@ -253,7 +253,14 @@ class ArtefactTypeBlog extends ArtefactType {
$javascript = require(get_config('docroot') . 'artefact/blog/render/blog_renderfull.js.php');
$smarty = smarty();
$smarty->assign('artefact', $this);
if (isset($options['viewid'])) {
$smarty->assign('artefacttitle', '<a href="' . get_config('wwwroot') . 'view/view.php?view='
. $options['viewid'] . '&artefact=' . $this->get('id')
. '">' . $this->get('title') . '</a>');
}
else {
$smarty->assign('artefacttitle', $this->get('title'));
}
$smarty->assign('blockid', $blockid);
$smarty->assign_by_ref('options', $options);
$smarty->assign_by_ref('javascript', $javascript);
......@@ -467,6 +474,14 @@ class ArtefactTypeBlogPost extends ArtefactType {
*/
protected function render_full($options) {
$smarty = smarty();
if (isset($options['viewid'])) {
$smarty->assign('artefacttitle', '<a href="' . get_config('wwwroot') . 'view/view.php?view='
. $options['viewid'] . '&artefact=' . $this->get('id')
. '">' . $this->get('title') . '</a>');
}
else {
$smarty->assign('artefacttitle', $this->get('title'));
}
$smarty->assign('artefact', $this);
$attachments = $this->get_attached_files();
if ($attachments) {
......
......@@ -6,7 +6,7 @@
{$javascript}
</script>
<h2>{$artefact->get('title')|escape}</h2>
<h2>{$artefacttitle}</h2>
<table id="blog_renderfull{$blockid}">
<thead></thead>
......
......@@ -2,7 +2,7 @@
* This template displays a blog post.
*}
<div>
<h3>{$artefact->get('title')|escape}</h3>
<h3>{$artefacttitle}</h3>
<div>{$artefact->get('description')}</div>
{if isset($attachments)}
<table>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment