1. Alexander
  2. Plugins
  3. Monday, 24 January 2011
  4.  Subscribe via email
I've created a custom component, com_stories. It's a sort of testimonials manager. I've created a custom !joomlacomment plugin that allows users to comment on other users' testimonials. (Using !joomlacomment 4.0 RC1. I know, it's deprecated. We'll probably upgrade when we move to Joomla! 1.6.)

This component has two views: stories, which lists all testimonials (paginated) with readon links, and story, which displays a single testimonial including comments. I've modified checkVisual in the plugin to check which view com_stories is in and give a readon link or show the comments depending. This is working perfectly.

Except: in the stories view, all the readon links point to id=0. Or if I set an id via url parameter (which is not meant to be done, by definition stories view is all ids), all of the readon links are to that id.

Before, I just generated the readon links in the component itself, but I would like to be able to show the number of comments on a given testimonial.

Here is the relevant code from com_stories stories view template:

default.php:

foreach ($this->rows as $this->row) {
echo $this->loadTemplate('story');
$i++;
}


and default_story.php:

row->name . '';
echo 'Posted ' . date('M. jS, Y', strtotime($this->row->submitted_date)) . '';
echo '' . $this->row->story . '';
echo $this->row->id;
global $option;
require(JPATH_SITE."/administrator/components/com_comment/plugin/$option/josc_com_stories.php");
?>


(Used require instead of require_once because otherwise only the first testimonial will have a readon link.)

Is there some way to pass the id of each testimonial to !joomlacomment so that the readon links point to the correct id of each item in the stories view, like they do on com_content's section blog and category blog layouts?

Any help would be greatly appreciated!

Alexander Clark

P.S. Sorry if this question has been answered before. I spent a lot of time googling and was unable to find anything.


There are 4 replies to this question. If you want to see them you need a valid subscription.
If you have a valid subscription, please login now.
Visit store now

Categories

General
  1. 3 subcategories
Billing
  1. 4 subcategories
Hotspots
  1. 11 subcategories
CComment
  1. 11 subcategories
Matukio
  1. 6 subcategories
CMigrator
  1. 4 subcategories
CForms
  1. 2 subcategories
International Zone
  1. 10 subcategories
Free extensions
  1. 47 subcategories
Archive
  1. 15 subcategories

Last questions

Robots registrations
Hi, I have houndrets of registrations for Matukio event by robots. Is there a...
0 Replies
Posted on Sunday, 18 February 2018
  • New
  • problem, your plug_hotspots is still not compatibl
    Hello, I just updated your com_hotspots-5.2.1-pro component to com_hotspots-5.3...
    3 Replies
    Posted on Tuesday, 05 December 2017
    First Data gateway for Matukio - Ignite?
    On your landing page for Matukio you list Ignite (First Data) as a gateway, but ...
    1 Replies
    Posted on Thursday, 15 February 2018
  • New
  • Automatische Absage funktioniert nicht
    Hallo, meine Veranstaltungen wurden wie folgt konfiguriert: Max. Teilnehme...
    9 Replies
    Posted on Tuesday, 21 November 2017
    • #events
    Alter wording in matukiofees Default Booking Form
    Attached is an image of the booking form I find in my front end. I would like t...
    0 Replies
    Posted on Thursday, 15 February 2018
  • New