Showing element above list

Hi guys,

I have a list (listA) with a link button that opens another list (listB) with related data. I would like to show some elements from listA above listB to identify where it came from, like

{mytable___jobnumber}/{mytable___jobdescription}

etc. I pass the jobnumber to listB as parameter on the URL so when listB opens I know what row in listA it is referring to and can fetch the information in php when the list loads.

But how can I show it in the list intro? Ideas?

Best regards,
Arnor
 
Use Sourcerer (from Regular Labs) to embed some code in the list intro.

Code:
{source}
<?php
$input = JFactory::getDocument()->input;
$jobNumber = $input->get('mytable___jobnumber', '');
if (!empty($jobNumber)) {
   $myDb = JFactory::getDbo();
   $myQuery = $myDb->getQuery(true);
   $myQuery->select('*')->from('mytable')->where('jobnumber = ' . $myDb->quote($jobNumber));
   $myDb->setQuery($myQuery);
   $job = $myDb->loadObject();
   echo $jobNumber . '/' . $job->jobdescription;
}
?>
{/source}

Obviously change table name and fields to suit.

-- hugh
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top