News:

Support the VirtueMart project and become a member

Main Menu

How to display categories' description in frontpage?

Started by panoss, August 31, 2016, 09:17:21 AM

Previous topic - Next topic

panoss

My VM frontpage displays categories.
But displays only the image, not the description.
How can I make it display the description?
Virtuemart 3.2.4 on Joomla! 3.8.0

VMTemplates.net

Hi,

you may need to use html override. If you already have it please open /templates/YOUR_TEMPLATE/html/com_virtuemart/sublayouts/categories.php
and paste this code below somewhere between lines 67 and 79:

<?php echo shopFunctionsF::limitStringByWord ($category->category_description150' ...'?>

in these lines:

    <div class="category floatleft<?php echo $category_cellwidth $show_vertical_separator ?>">
      <div class="spacer">
        <h2>
          <a href="<?php echo $caturl ?>" title="<?php echo vmText::_($category->category_name?>">
          <?php echo vmText::_($category->category_name?>
          <br />
          <?php // if ($category->ids) {
            
echo $category->images[0]->displayMediaThumb("",false);
          
//} ?>

          </a>
        </h2>
      </div>
    </div>


If your template does not provide override you can make it by copy
/components/com_virtuemart/sublayouts/categories.php
and paste it to
/templates/YOUR_TEMPLATE/html/com_virtuemart/sublayouts/
We develop VirtueMart templates since 2008
https://www.virtuemarttemplates.net/
Join the VirtueMart Templates Club today and get an access to over 60 VirtueMart templates
https://www.virtuemarttemplates.net/template-club.html
If you need a custom VirtueMart Template design please visit https://www.virtuemarttemplates.net/custom-virtuemart-template-design.html
Visit our new shop https://demo.virtuemarttemplates.net/
Join the VirtueMart Templates Club, purchase the template or order one of our services like Hosting, Website Maintenance, Security and Optimization, Template Customization and more

panoss

I put it directly in the code, without override, works fine.

I just hoped that it could be done without changing the code (not even with an override).
I guess it can't be done in some other way.

Thank you for your help!
Virtuemart 3.2.4 on Joomla! 3.8.0

Studio 42

panoss, you cannot update virtuemart, or you loose your changes, it's why overide is better.

panoss

I didn't think of this, thanks, I'll make an override.
Virtuemart 3.2.4 on Joomla! 3.8.0