Accounts Posted August 15, 2010 Share Posted August 15, 2010 Basically, I want the category logo to appear in-between the header and the left/center columns, like this:http://i.imgur.com/bC11j.pngHow would I do that?Thanks. Link to comment Share on other sites More sharing options...
Accounts Posted August 24, 2010 Author Share Posted August 24, 2010 Sorry for the bump, but is there no way to do this? Currently I've tried repositioning the logo using css, but it doesn't look right and cat's with no logos will be too high. Link to comment Share on other sites More sharing options...
MrBaseball34 Posted August 24, 2010 Share Posted August 24, 2010 try moving this code from category.tpl: {if $scenes} <!-- Scenes --> {include file=$tpl_dir./scenes.tpl scenes=$scenes} {else} <!-- Category image --> {if $category->id_image} id_image}-category.jpg" alt="{$category->name|escape:'htmlall':'UTF-8'}" title="{$category->name|escape:'htmlall':'UTF-8'}" id="categoryImage" /> {/if} {/if} after this code in header.tpl: <!-- Header --> {$HOOK_TOP} Link to comment Share on other sites More sharing options...
rocky Posted August 24, 2010 Share Posted August 24, 2010 It's not so easy unfortunately. The $category variable is not available in header.tpl. You'll need to add code like the following to header.php before you can use that variable: if (isset($_GET['id_category'])) { $category = new Category(intval(Tools::getValue('id_category')), intval($cookie->id_lang)); if (!Validate::isLoadedObject($category)) $errors[] = Tools::displayError('category does not exist'); elseif (!$category->checkAccess(intval($cookie->id_customer))) $errors[] = Tools::displayError('you do not have access to this category'); else { $category->name = Category::hideCategoryPosition($category->name); $smarty->assign('category', $category); } } then you can add the following to header.tpl: <!-- Category image --> {if $category->id_image} <img src="{$link->getCatImageLink($category->link_rewrite, $category->id_image, 'category')}" alt="{$category->name|escape:'htmlall':'UTF-8'}" title="{$category->name|escape:'htmlall':'UTF-8'}" id="categoryImage" /> {/if} Link to comment Share on other sites More sharing options...
MrBaseball34 Posted August 24, 2010 Share Posted August 24, 2010 The $category variable is not available in header.tpl Oops, forgot about that.Thanks for picking me up, rocky... Link to comment Share on other sites More sharing options...
Linkstate Posted November 16, 2010 Share Posted November 16, 2010 For product page you want to get default category for product with something like: if (isset($_GET['id_product']) AND Validate::isUnsignedId($_GET['id_product'])){ $idProduct = intval(Tools::getValue('id_product')); $product = new Product(intval($idProduct)); $_GET['id_category'] = $product->id_category_default; } Link to comment Share on other sites More sharing options...
Recommended Posts