View Single Post
  #2  
Old December 10th, 2013, 10:40 PM
Eric's Avatar
Eric Eric is offline
Datafeedr Team
 
Join Date: Feb 2008
Posts: 16,902
Default

Hi,

Well, there's no simple way to do it. However you can use a little php conditional to check what to display.

For example, to hide your list of products and pagination on Top level category pages, you would wrap all of the code in your Product list module between these 2 tags:

PHP Code:
<?php if ( $category->parent != ) : ?>
PHP Code:
<?php endif; ?>
Basically that says if this category is NOT a parent category (ie. equal to 0) then display what is between these tags.

Maybe this will make more sense:

PHP Code:
<?php if ( $category->parent != ) : ?>
    Display sub-category stuff here
<?php endif; ?>

<?php if ( $category->parent == ) : ?>
    Display top level category stuff here
<?php endif; ?>
So if you go here: The Factory > Your Store > VIEWS > CATEGORY PAGE > Default > Product list > Theme settings () and change the code that you have in there to this:

HTML Code:
<?php if ( $category->parent != 0 ) : ?>

<!-- Pagination Links (Top) -->
<div class="pgr">
  Pages:
  [pager.first text='<img src="[server.plugin_url]/first.gif" alt="first page" />' alt='']
  [pager.prev text='<img src="[server.plugin_url]/prev.gif" alt="prev page" />' alt='']
  [pager.pages delim=' ']
  [pager.next text='<img src="[server.plugin_url]/next.gif" alt="next page" />' alt='']
  [pager.last text='<img src="[server.plugin_url]/last.gif" alt="last page" />' alt='']
</div>
<!-- /Pagination Links (Top) -->


<!-- Product List -->
<div class="pl">
  [product.each]
  <div class="t1 col3">
  <div class="bdr">
    <h2><a href="[product.link]" title="[product.name]">[product.name]</a></h2>
    <div class="thmb"><a href="[product.link]" title="[product.name]">[product.thumbnail tag='1']</a></div>
    <div class="prc">[product.currency mode="sign"][product.price]</div>
    <p class="desc">[product.description]</p>
    <div class="btns">
    <a href="[product.link]" title="View details of [product.name]" class="dfbutton dfred dflarge dfrounded">More Details</a>
    </div>
    <div class="clearingdiv"> </div>
  </div>
  </div>
  [/product.each]
  <div class="clearingdiv"> </div>
</div>
<!-- /Product List -->


<!-- Pagination Links (Bottom) -->
<div class="pgr">
  Pages:
  [pager.first text='<img src="[server.plugin_url]/first.gif" alt="first page" />' alt='']
  [pager.prev text='<img src="[server.plugin_url]/prev.gif" alt="prev page" />' alt='']
  [pager.pages delim=' ']
  [pager.next text='<img src="[server.plugin_url]/next.gif" alt="next page" />' alt='']
  [pager.last text='<img src="[server.plugin_url]/last.gif" alt="last page" />' alt='']
</div>
<!-- /Pagination Links (Bottom) -->

<?php endif; ?>
... then your products will show only on sub-category pages.

The same applies to your category images... You can wrap them in those PHP tags depending on what you want to display and on what type of page.

Eric