Move category children after category description

Rate this topic: Evaluations: 1, 1.00 on the average.Evaluations: 1, 1.00 on the average.Evaluations: 1, 1.00 on the average.Evaluations: 1, 1.00 on the average.Evaluations: 1, 1.00 on the average.Evaluations: 1, 1.00 on the average.1.00 out of 6 based on 1 vote(s)
GK User
Wed Jan 14, 2015 10:22 pm
Reply with quote
Report this post
Hi,

I need move list of subcategories (categories children) after category description on my site autosolcz.cz. Reason is better SEO. How I can do it?

I am putting screenshot.

Thank you
User avatar
Expert Boarder

teitbite
Thu Jan 15, 2015 11:25 am
Reply with quote
Report this post
Hi

Please edit /html/com_virtuemart/category/default.php and move code:

Code: Select all
/* Show child categories */
if ( VmConfig::get('showCategory',1) and empty($this->keyword)) {
      if (!empty($this->category->haschildren)) {
      // Category and Columns Counter
      $iCol = 1;
      $iCategory = 1;
      // Calculating Categories Per Row
      $categories_per_row = VmConfig::get ( 'categories_per_row', 3 );
      $category_cellwidth = ' width'.floor ( 100 / $categories_per_row );
      $BrowseTotalProducts = count($this->products);
      // Separator
      $verticalseparator = " vertical-separator";
   ?>
   <div class="category-view">
      <?php // Start the Output
      if(!empty($this->category->children)) {
      foreach ( $this->category->children as $category ) { ?>
      <?php if ($iCol == 1 && $iCategory > $categories_per_row) : ?>
      <div class="horizontal-separator"></div>
      <?php endif; ?>
      
      <?php if ($iCol == 1) : ?>
      <div class="row">
      <?php endif; ?>
            <?php
         // Show the vertical seperator
         if ($iCategory == $categories_per_row or $iCategory % $categories_per_row == 0) {
            $show_vertical_separator = ' ';
         } else {
            $show_vertical_separator = $verticalseparator;
         }

         // Category Link
         $caturl = JRoute::_ ( 'index.php?option=com_virtuemart&view=category&virtuemart_category_id=' . $category->virtuemart_category_id );

            // Show Category ?>
            <div class="category floatleft<?php echo $category_cellwidth . $show_vertical_separator ?>">
               <div class="spacer">
                  <a href="<?php echo $caturl ?>" title="<?php echo $category->category_name ?>"><?php echo $category->images[0]->displayMediaThumb("",false); ?></a>
                  
                  <h2 class="catSub"> <a href="<?php echo $caturl ?>" title="<?php echo $category->category_name ?>"> <?php echo $category->category_name ?> </a> </h2>
               </div>
            </div>
            <?php
         $iCategory ++;

      // Do we need to close the current row now?
      if ($iCol == $categories_per_row) { ?>
            <div class="clear"></div>
      </div>
      <?php
         $iCol = 1;
      } else {
         $iCol ++;
      }
   }
   }
   // Do we need a final closing row tag?
   if ($iCol != 1) { ?>
      <div class="clear"></div>
</div>
<?php } ?>
</div>
<?php }
}

?>


under this part:

Code: Select all
      <?php if (empty($this->keyword) && !empty($this->category) && !empty($this->category->category_description)) : ?>
      <p class="category_description">
         <?php echo $this->category->category_description; ?>
      </p>
      <?php endif; ?>
User avatar
Moderator

GK User
Thu Jan 15, 2015 12:34 pm
Reply with quote
Report this post
Thank you, but the code is not in this template file. There is little bit different code and if I follow your guides, I see only blank page. Please check it.

Code: Select all
      <?php if (empty($this->keyword) && !empty($this->category) && !empty($this->category->category_description)) : ?>
      <p class="category_description">
         <?php echo $this->category->category_description; ?>
      </p>
      <?php endif; ?>
[/quote]
User avatar
Expert Boarder

teitbite
Fri Jan 16, 2015 8:11 pm
Reply with quote
Report this post
Hi

Please send me an access to FTP so I'll see how this can be done on Your copy.
User avatar
Moderator

teitbite
Wed Jan 21, 2015 10:04 am
Reply with quote
Report this post
Hi

I've made the change, but please check it now. I had no url to Your website so I cannot check if that worked.
User avatar
Moderator

GK User
Wed Jan 21, 2015 10:09 am
Reply with quote
Report this post
Hi,

it works great. You can find it here http://www.autosolcz.cz. Thank you very much ;-)
User avatar
Expert Boarder

teitbite
Thu Jan 22, 2015 6:19 pm
Reply with quote
Report this post
Hi

Great to hear it's working. I'm closing this thread than.
User avatar
Moderator


cron