• 1

Read this first!

We do not monitor these forums. The forum is provided to exchange information and experience with other users ONLY. Forum responses are not guaranteed.

However, please submit a ticket if you have an active subscription and wish to receive support. Our ticketing system is the only way of getting in touch with RSJoomla! and receiving the official RSJoomla! Customer Support.

For more information, the Support Policy is located here.

Thank you!

TOPIC: Link to #directoryCol in PHP Scripts

Link to #directoryCol in PHP Scripts 8 months 2 weeks ago #42896

  • fcollins
  • fcollins's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 1
In a RSForm Pro! form directory listing, I just want to create a link to view a submission. For instance, I have a directory of Jobs, and I just want to create a link under the Position Title to view that submission. I know I need to use the {global:submissionId} somehow.

in the directory PHP scripts section, I figured out how to add the ID column next to the Position Title using the following, but how can I just create a link under Position Title to view the submission?

$pattern = '#directoryColSubmissionid">.*?</td>#';
if (preg_match_all($pattern, $directoryLayout, $matches)){
foreach ($matches[0] as $i => $fullMatch){
$shrink = substr($fullMatch, 0, -5);
$string = explode(">",$shrink);
$yourHref = $string[0].'><a href="/jobs/submission-view/'.$string[1].'">'.$string[1].'</a></td>';
$directoryLayout = str_replace($fullMatch, $yourHref , $directoryLayout);
}
}

$pattern = '#directoryColPositiontitle">.*?</td>#';
if (preg_match_all($pattern, $directoryLayout, $matches)){
foreach ($matches[0] as $i => $fullMatch){
$shrink = substr($fullMatch, 0, -5);
$string = explode(">",$shrink);
$yourHref = $string[0].'><b>'.$string[1].'</b></td>';
$directoryLayout = str_replace($fullMatch, $yourHref , $directoryLayout);
}
}

Thanks!
The administrator has disabled public write access.

Link to #directoryCol in PHP Scripts 8 months 1 week ago #42922

  • andreic
  • andreic's Avatar
  • OFFLINE
  • RSJoomla! Official Staff
  • Posts: 722
  • Thank you received: 59
Hello,

The best course of action would be to create a template override for the directly listing and add the link to your desired field value. You will need to create a template override for the \components\com_rsform\views\directory\tmpl\default_layout.php file.

You can already find the script that generates the link to the submission details in the layout for the "View" icon so you only need to copy this over.

<a class="<?php echo $this->tooltipClass; ?> directoryDetail" title="<?php echo RSFormProHelper::getTooltipText(JText::_('RSFP_SUBM_DIR_VIEW')); ?>" href="<?php echo JRoute::_('index.php?option=com_rsform&view=directory&layout=view&id='.$item->SubmissionId); ?>">
<span class="rsficon rsficon-zoom-in"></span>
</a>

This should provide a good starting point for your scenario.
Please note: my help is not official customer support. To receive your support, submit a ticket by clicking here
Regards,
RSJoomla! Development Team
The administrator has disabled public write access.
  • 1

Read this first!

We do not monitor these forums. The forum is provided to exchange information and experience with other users ONLY. Forum responses are not guaranteed.

However, please submit a ticket if you have an active subscription and wish to receive support. Our ticketing system is the only way of getting in touch with RSJoomla! and receiving the official RSJoomla! Customer Support.

For more information, the Support Policy is located here.

Thank you!