Bei smarty3 war irgendwas mit dem {php} tag. Den muss man glaube ich erst in der sicherheitskonfiguration erlauben.
Wenn Du aber in Deinem Template in den Ordner Smarty das einbaust:
function.productlink.php
<?php
function smarty_function_productlink($params, &$smarty) {
return xtc_href_link(FILENAME_PRODUCT_INFO, 'products_id='.$params['products_id']);
}
?>
Geht im Template, das:
<a href="{productlink products_id='345'}">Some Text</a>
Das ganze könnte man noch erweitern ....
function.mylink.php
<?phpfunction smarty_function_mylink
($params, &$smarty) { if (isset($params['products_id'])) return xtc_href_link
(FILENAME_PRODUCT_INFO
, 'products_id='.$params['products_id']); if (isset($params['coID'])) return xtc_href_link
(FILENAME_CONTENT
, 'coID='.$params['coID']); if (isset($params['cPath'])) return xtc_href_link
(FILENAME_DEFAULT
, 'cPath='.$params['cPath']);}?> <a href="{mylink products_id='17'}">Link zu Produkt 17</a>
<a href="{mylink coID='17'}">Link zu Content 17</a>
<a href="{mylink cPath='17'}">Link zu Kategorie 17</a>
Oder die Kuschelweischlösung, ohne sich merken zu müssen wie denn der Parameter lautet:
<?php
function smarty_function_mylink($params, &$smarty) {
switch ($params['target']) {
case "Artikel":
return xtc_href_link(FILENAME_PRODUCT_INFO, 'products_id='.$params['id']);
break;
case "Kategorie":
return xtc_href_link(FILENAME_DEFAULT, 'cPath='.$params['id']);
break;
case "Content":
return xtc_href_link(FILENAME_CONTENT, 'coID='.$params['id']);
break;
}
}
?>
<a href="{mylink target='Artikel' id='17'}">Link zu Produkt 17</a>
<a href="{mylink target='Kategorie' id='17'}">Link zu Kategorie 17</a>
<a href="{mylink target='Content' id='17'}">Link zu Content 17</a>
BTW ... ich hab keine Ahnung was Du da vorhast, aber existiert die Datei catalog_download.php und nimmt auch den $_GET Parameter id an?