By tylr23 on Thursday, 13 August 2020
Posted in General Issues
Replies 3
Likes 0
Views 860
Votes 0
Hi,

On the easyboard dashboard comment view you get to see the permanent url of the comment with the following :


<?php if ($comment->isPublished()) { ?>
<li>
<a href="<?php echo $comment->getPermalink();?>" target="_blank"><?php echo JText::_('COM_EASYBLOG_DASHBOARD_VIEW_COMMENT');?></a>
</li>
<?php } ?>


However if you just copy and paste this line in the latest comment module both
the "isPublished()" or "getPermalink()" method are not usable(Call to undefined method error)

How can I use those methods in tmpl/default.php (I did not find any particular include in the default.php of the dashboard comment view)?

Thank you for your time.
Hi,

Thanks a lot for the help and the detailed explanations Yasser, it works !

Actually I placed the following in the helper.php

$item = EB::table('Comment');


and in rest the default.php


<?php $item->bind($comment) ?>

<a href="<?php echo $item->getPermalink() ;?>">Comment direct </a>
·
Friday, 14 August 2020 20:28
·
0 Likes
·
0 Votes
·
0 Comments
·
Hi there,

Methods `getPermalink()` & `isPublished()` for comment relies on the `EasyBlogTableComment`, but however, in Latest Comment Module the comment object there didn't have `EasyBlogTableComment` object. Therefore, you cannot call these methods.

So, in order for you to use these methods, you'll need to load `EasyBlogTableComment` and bind these comments. You can use something like this:

$item = EB::table('Comment');
$item->bind($comment);

$item->getPermalink();


Checkout attached screenshot. By the way, please do remember this is a core file (/modules/mod_easybloglatestcomment/tmpl/default.php) which it will get overwritten when updating EasyBlog in the future. Hence, please utilize template module override for this customization so it would be safer. Checkout this documentation: https://docs.joomla.org/How_to_override_the_output_from_the_Joomla!_core

Hope this helps and good luck.
Thanks.
·
Friday, 14 August 2020 11:22
·
0 Likes
·
0 Votes
·
0 Comments
·
Hi there,

You are most welcome. Glad to hear that your issue has been resolved now.

Just for your information, I have locked and marked this thread as resolved to avoid confusions in the future. Please start a new thread if you have any other issue in the future so it will be easier for us to manage your inquiries.

Thanks for understanding.
·
Monday, 17 August 2020 10:19
·
0 Likes
·
0 Votes
·
0 Comments
·
View Full Post