Datafeedr Support Forums

Datafeedr Support Forums (/index.php)
-   Questions (/forumdisplay.php?f=67)
-   -   Top Level Category View (/showthread.php?t=9977)

konstruweb December 10th, 2013 09:57 PM

Top Level Category View
 
Hello, I reordered my store in categories and sub-categories, I wonder if is possible to establish a custom view just to my top level categories, integrating thumbnails and removing list of products. (image attached)



http://www.thepaintballstore.net/sho...gory/clothing/

Thanks in advance,

Mauricio

Eric December 10th, 2013 10:40 PM

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

konstruweb December 11th, 2013 01:53 PM

Thanks Eric!, im going to make that code test,

have a great day

Mauricio


All times are GMT -5. The time now is 01:11 PM.

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2021, Jelsoft Enterprises Ltd.