VirtueMart Forum

VirtueMart 2 + 3 + 4 => Templating & Layouts => Topic started by: djmrman1 on April 21, 2020, 06:49:35 AM

Title: Category Name placement
Post by: djmrman1 on April 21, 2020, 06:49:35 AM
HI hoping someone can help is there a way to have the category name at the bottom of the image is it some thing in virtuemart or the way maybe artisteer created the template

http://www.starlightcinema.co.nz/Farmers_Discount_Meats/

Thanks
Jeremy
Title: Re: Category Name placement
Post by: Jörgen on April 21, 2020, 06:54:40 AM
This is a template issue. Compare to the VM demo in VM website or test with protostar or beez template.
Jörgen @ Kreativ Fotografi
Title: Re: Category Name placement
Post by: djmrman1 on April 21, 2020, 07:11:04 AM
Still have it appearing above not below
Title: Re: Category Name placement
Post by: Jörgen on April 21, 2020, 07:37:58 AM
You are right, I see that now, I have an override in my template for this.

If i remember correctly, go in and change the file
templates/your template/html/com_virtuemart/category/default.php (http://templates/your%20template/html/com_virtuemart/category/default.php)

If the file does not exist make a copy of the original file and use as override.

In the file You move the category description to where you want it.

Jörgen @ Kreativ Fotografi
Title: Re: Category Name placement
Post by: djmrman1 on April 21, 2020, 09:44:04 AM
Found it in components/com_virtuemart/sublayouts/categories.php and about line 75 and changed it to the following

<h2>
          <a href="<?php echo $caturl ?>" title="<?php echo vmText::_($category->category_name) ?>">
          <?php // if ($category->ids) {
            echo $category->images[0]->displayMediaThumb("",false);
          //} ?>
          <br />
          <?php echo vmText::_($category->category_name) ?>
          </a>
        </h2>
Title: Re: Category Name placement
Post by: Jörgen on April 21, 2020, 10:10:22 AM
Glad You found it, Sorry that I did not point to the correct file :(

Jörgen
Title: Re: Category Name placement
Post by: djmrman1 on April 22, 2020, 02:30:26 AM
No Problem you still got me to think of the issue in a Different way Thanks for your help
Title: Re: Category Name placement
Post by: Jörgen on April 22, 2020, 07:09:50 AM
Do not forget to make an override. You have changed core File.
Jörgen
Title: Re: Category Name placement
Post by: djmrman1 on April 23, 2020, 03:23:09 AM
Could you please tell me the best way to create a override as I have never done that
Title: Re: Category Name placement
Post by: Jörgen on April 23, 2020, 07:09:40 AM
Because Your fix works there is probabaly no override active right now, but just to be sure:

Check if the override exists:
templates/your-template/html/com_virtuemart/sublayouts/categories.php (http://templates/your-template/html/com_virtuemart/sublayouts/categories.php)

If it exists make the correction in this file. if it doesn´t, copy your edited file into this position and restore the original file.

Then your changes will be safe for the next update of VM.

Yo can also go through Joomla and let Joomla prepare the overrides (copies the original files to Your template directory). The only downside is that this will make copies of all the files that can be used for override of com_virtuemart instead of just this file. A bit overkill if You do not make any other changes.

This time it would be good to make sure that Your override is the file used not the original file, btw do not delete the original usually it has to be there to make the override work. Make an debugging edit in the override to make sure that it is the file used, then clean up the edit.

Jörgen @ Kreativ Fotografi
Title: Re: Category Name placement
Post by: djmrman1 on April 24, 2020, 01:20:15 AM
Thank you, You are truly a legend thanks for all your help.