Jump to content

Category per row adjustment


Guest

Recommended Posts

As highlighted in the pic, can anyone guide me on how to place / have more sub category placed on each row rather than just having 3?

Prob: I'm using the killer skin, and once in that category, having only 3 sub cat in a row looks real weird off...

prob.gif

Link to comment
Share on other sites

Guest taherhs

Hi,

I made it 3 per row. You may want more or less.

Try this in viewCat.tpl (in killer/styleTemplate/content)

<div id="subCats"><center>

<table border="0" width="100%" cellspacing="0" cellpadding="10" align="center">

<tr align="center"><td align="center">

<!-- BEGIN: sub_cats_loop -->

<span class="subCat"><center>

<a href="index.php?act=viewCat&amp;catId={TXT_LINK_CATID}" class="txtDefault"><img src="{IMG_CATEGORY}" border="0" alt="{TXT_CATEGORY}" /></a><br />

<a href="index.php?act=viewCat&amp;catId={TXT_LINK_CATID}" class="txtDefault">{TXT_CATEGORY}</a> ({NO_PRODUCTS})

<!-- BEGIN: nextrow -->

</td></tr><tr align="center"><td align="center">

<!-- END: nextrow -->

</center>

</span>

</div>

and this in viewCat.inc.php (include/content)

$j=0;

for ($i=0; $i<count($subCategoroies); $i++){

if(empty($subCategoroies[$i]['cat_image'])){

$view_cat->assign("IMG_CATEGORY",$GLOBALS['rootRel']."skins/".$config['skinDir']."/styleImages/catnophoto.gif");

} else {

$view_cat->assign("IMG_CATEGORY",$GLOBALS['rootRel']."images/uploads/".$subCategoroies[$i]['cat_image']);

}

$view_cat->assign("TXT_LINK_CATID",$subCategoroies[$i]['cat_id']);

$view_cat->assign("TXT_CATEGORY", $subCategoroies[$i]['cat_name']);

$view_cat->assign("NO_PRODUCTS", $subCategoroies[$i]['noProducts']);

$j++;

if ($j == 3){

$j = 0;

$view_cat->parse("view_cat.sub_cats.sub_cats_loop.nextrow");

}

$view_cat->parse("view_cat.sub_cats.sub_cats_loop");

} // end loop results

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...