Category Link

Hiii, I need some help. I know it’s something easy but im not able to do it good. There are a categories list in my website and I want just one of them to have a link to a external page. We have to put in the code that when it reaches the “id” of the category I want to change the link, it changes it ( id = 14 in my case). Ill put the bit of the code :

foreach( $categories as $category ) {
$cocinas=“14”;
if ($iCol == 1) { // this is an indicator wether a row needs to be opened or not
echo “

\n”;
}
?>
<td align="center" width="<?php echo $cellwidth ?>%" >
	<br />
     <a title="<?php echo $category["category_name"] ?>" 

href="<?php $sess->purl(URL."index.php?option=com_virtuemart&page=shop.browse&category_id=".$category["category_id"]) ?>">

Thanks you all, and sorry for my english :):):slight_smile:

JomeR, do not be bothered about your English! Glad to have you here!

So, I am not exactly sure as to what you want. But, I hope this is it…

[php]

<?PHP foreach( $categories as $category ) { $cocinas="14"; if ($iCol == 1) { // this is an indicator wether a row needs to be opened or not echo '
';
  echo '<a title="<?php echo $category["category_name"] ?>';
  echo 'href="<?php $sess->purl(URL."index.php?option=com_virtuemart&amp;page=shop.browse&amp;category_id=".$category["category_id"]) ?>">';
  echo '</td>'; 
  }

}
?>
[/php]

Note: the single quotes enclose the lines. The double quotes are passed into the HTML, so this should work.
Not really sure that is what you want. Hope it helps…

Sponsor our Newsletter | Privacy Policy | Terms of Service