Forums

Chronocontact Mambot - determining what article it's in

ve6sar 09 Apr, 2010
We use our internal web site to distribute memos to our employees and need a way for them to acknowledge that they have read and understood the memo. So I thought I'd use the Chronocontact Mambot to insert a simple form.

Has anyone figured out how to get the mambot determine what article it's inserted into so the article id can be submitted as part of the form?

Thanks
Sean
GreyHead 24 Apr, 2010
Hi Sean,

This code should do the trick:
<?php
$article_id =& JRequest::getInt('id', '', 'get'); 
?>
<input type='hidden' name='article_id' value='<?=$article_id?>' />


Bob
ve6sar 14 May, 2010
Thanks Bob,

That code works if you are in a page where a single article is displayed, but if it's on the Front page or any other blog layout it displays the section ID by the looks of it.

I'll keep looking around there has to be a way to do it....

Sean
GreyHead 15 May, 2010
Hi ve6sar,

Well yes, on the home page and on blog pages there isn't a 'single' article to identify,

Bob
kardana 08 Jun, 2010
I need to do the same thing. Were you able to figure this out?

thanks
sendas 14 Jun, 2010
To do the page title.

Put this code at the top of your form
<?php
 
$mydoc =& JFactory::getDocument();
$mytitle = $mydoc->getTitle();
 
?>


then you can use this.

<input type='hidden' name='article_id' value='<?php echo $mytitle; ?>' />
This topic is locked and no more replies can be posted.