Jump to content

Category View Changes


Guest mmjosh1010

Recommended Posts

Guest mmjosh1010

Sorry I know not a lot of you won't be interested in this but just wondering if anyone could tell me how to do something. I have changed the way Sub-Category's are viewed (just an experiment) but if you look on:

http://www.software247.co.uk/new/index.php...Cat&catId=3

I want just 1 category to appear on each line but at the moment about 2 can fit, how can I make it so there is just one category on each line?

Thanks

Link to comment
Share on other sites

Guest Brivtech

You'll need to play around in your template file:

Open skins/Carreta-Soft/styleTemplates/contents/viewCat.tpl

This chunk of code determines how your categories are displayed:

<!-- BEGIN: sub_cats -->

<div id="SubCategories">

<!-- BEGIN: sub_cats_loop -->

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

<a href="index.php?_a=viewCat&amp;catId={TXT_LINK_CATID}" title="{TXT_CATEGORY}">{TXT_CATEGORY}</a> ({NO_PRODUCTS})</div>

<!-- END: sub_cats_loop -->

</div>

<br clear="all" />

<!-- END: sub_cats -->




If you replace it with:


<!-- BEGIN: sub_cats -->

<div id="SubCategories">

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

<!-- BEGIN: sub_cats_loop -->

  <tr>

	<td>

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

<a href="index.php?_a=viewCat&amp;catId={TXT_LINK_CATID}" title="{TXT_CATEGORY}">{TXT_CATEGORY}</a> ({NO_PRODUCTS})</div>

</td>

  </tr>

<!-- END: sub_cats_loop -->

</table></div>

<br clear="all" />

<!-- END: sub_cats -->

... then you'll be able to achieve what you're after.

The table forces a new row for each category that's being displayed in a sub-category view. Note that the table declarations are before and after the main loop. The rows are assigned within the loop, so you get a new row for each new product being displayed.

CSS Purists - Eat your hearts out! :yeahhh:

Please let me know if it does the trick for you!

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...