aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--engine/lib/views.php1
-rw-r--r--mod/blog/views/default/object/blog.php11
-rw-r--r--views/default/layout/elements/comments.php8
3 files changed, 13 insertions, 7 deletions
diff --git a/engine/lib/views.php b/engine/lib/views.php
index 5214e96c3..1e309f5bd 100644
--- a/engine/lib/views.php
+++ b/engine/lib/views.php
@@ -981,6 +981,7 @@ function elgg_view_comments($entity, $add_comment = true) {
$params = array(
'entity' => $entity,
'show_add_form' => $add_comment,
+ 'id' => "{$entity->getSubtype()}-comments",
);
$output = elgg_view('layout/elements/comments', $params);
diff --git a/mod/blog/views/default/object/blog.php b/mod/blog/views/default/object/blog.php
index 199a7c822..639031113 100644
--- a/mod/blog/views/default/object/blog.php
+++ b/mod/blog/views/default/object/blog.php
@@ -37,7 +37,10 @@ if ($blog->comments_on != 'Off') {
//only display if there are commments
if ($comments_count != 0) {
$text = elgg_echo("comments") . " ($comments_count)";
- $comments_link = "<a href=\"{$blog->getURL()}#annotations\">$text</a>";
+ $comments_link = elgg_view('output/url', array(
+ 'href' => $blog->getURL() . '#blog-comments',
+ 'text' => $text,
+ ));
} else {
$comments_link = '';
}
@@ -47,7 +50,7 @@ if ($blog->comments_on != 'Off') {
// access is always shown.
$metadata = '<ul class="elgg-list-metadata">';
-$metadata .= '<li>' . elgg_view('output/access', array('entity' => $vars['entity'])) . '</li>';
+$metadata .= '<li>' . elgg_view('output/access', array('entity' => $blog)) . '</li>';
if (isloggedin() && $blog->getOwnerGUID() != get_loggedin_userid()) {
$likes = elgg_view_likes($blog);
@@ -90,10 +93,6 @@ $subtitle = "$author_text $date $categories $comments_link";
if ($full) {
- $params = array(
- 'title' => $blog->title,
- 'buttons' => '',
- );
$header = elgg_view_title($blog->title);
$params = array(
diff --git a/views/default/layout/elements/comments.php b/views/default/layout/elements/comments.php
index 6dbe51483..ca86bed2d 100644
--- a/views/default/layout/elements/comments.php
+++ b/views/default/layout/elements/comments.php
@@ -4,11 +4,17 @@
*
* @uses $vars['entity'] ElggEntity
* @uses $vars['show_add_form'] Display add form or not
+ * @uses $vars['id'] Optional id for the div
*/
$show_add_form = elgg_get_array_value('show_add_form', $vars, true);
-echo '<div class="elgg-comments">';
+$id = '';
+if (isset($vars['id'])) {
+ $id = "id =\"{$vars['id']}\"";
+}
+
+echo "<div $id class=\"elgg-comments\">";
echo list_annotations($vars['entity']->getGUID(), 'generic_comment');