Hi,
I have written a snippet that outputs a link to files uploaded directly to a database table. However, if I use the snippet more than once on the page, all the links on that page become the same as the last snippet listed on the page. Does anyone have an idea how I can separate the processing of these snippets so that I can use the snippet more than once on the page?
Below is the snippet code I’m using:
Snippet Call in content:
[!secDownload? &secID=`2` &secTag=`test2` &secTitle=`test2`!]
Snippet Code
<?php
// add $_GET['fid'] to url
$curr_Addr = $modx_config['base_path']."assets/modules/secFileManager/";
$connector = $_GET ? "&" : "?";
$secAddr = $curr_Addr."includes/downloadFiles.inc.php?fid=".$secID;
$modx->setPlaceholder('secAddr', $secAddr);
$modx->setPlaceholder('secTitle', $secTitle);
$modx->setPlaceholder('secTag', $secTag);
return $modx->getChunk('secLink');
?>
Chunk
<a href="#" title="[+secTitle+]" onclick="window.open('[+secAddr+]','Secure_Download','height=150,width=150')">[+secTag+]</a>
Please ask any questions you like, I’ll be happy to add any info you need. Thanks in advance.