kgeoffrey:
Ok, I figured it out. In define_main_page.php before my html
<? define('NEW_VARIABLE_1', '<a href="' . zen_href_link(FILENAME_DEFAULT, 'cPath=xx') . '">'); ?>
>
> Where "xx" is the category id desired.
>
> Then, before the image I want to link
>
> ```php
<? echo NEW_VARIABLE_1; ?>
following the image or link with </a>, of course.
There's nothing insecure about this, is there?
This should work (although it would be better to get the full cPath - for nested categories). You can directly use the output as well - skipping the define statement.
Categories (xx = category_id):
<?php
// Get the cPath
$cPath = zen_get_path($id);
// Strip out 0_ from top level cats
$cPath = str_replace('=0_', '=', $cPath); ?>
<a href="<?php echo zen_href_link(FILENAME_DEFAULT, $cPath); ?>" title="category link tooltip"><?php echo zen_get_categories_name(xx); ?></a>
Products (yy = product_id):
<a href="<?php echo zen_href_link(zen_get_info_page(yy), 'cPath=' . zen_get_generated_category_path_rev(zen_get_products_category_id(yy)) . '&products_id=yy'); ?>" title="product link tooltip"><?php echo zen_get_products_name(yy); ?></a>
You can of course substitute direct information for some of the functions calls if you have more than just the category_id / product_id available. You may also want to escape the returned product and category name just to be on the safe side.