VirtueMart Forum

VirtueMart 2 + 3 + 4 => Templating & Layouts => Topic started by: adamjedgar on October 08, 2012, 03:27:05 AM

Title: how do i turn off Virtuemart-category thumbnails? I just want a category list!
Post by: adamjedgar on October 08, 2012, 03:27:05 AM
how do i only show my categories as a list...without any of those pesky category thumbnails.

I wish there was a simple checkbox in the Virtuemart admin to turn the damn things off. (this is an absolute pain in the "royal seat"!!! >:()
Title: Re: how do i turn off Virtuemart-category thumbnails? I just want a category list!
Post by: bytelord on October 08, 2012, 04:06:50 AM
Hello,

Just don't place an image for the category!

Regards
Title: Re: how do i turn off Virtuemart-category thumbnails? I just want a category list!
Post by: adamjedgar on October 08, 2012, 22:34:31 PM
hmmm,
i dont have an image placed for any categories, but it keeps putting in the default "no image" image whenever the categories are displayed in the main content area of my web pages. is it some kind of built in script? how do i turn that off??
Title: Re: how do i turn off Virtuemart-category thumbnails? I just want a category list!
Post by: bytelord on October 08, 2012, 22:59:32 PM
Hello,

Take a look here: http://forum.virtuemart.net/index.php?topic=106232.0

or you could just rename the image noimage.gif under com_virtuemart\assets\images\vmgeneral\noimage.gif, or create a no-image override with nothing 1x1p.

Regards
Title: Re: how do i turn off Virtuemart-category thumbnails? I just want a category list!
Post by: adamjedgar on October 08, 2012, 23:09:23 PM
ok ill have a go at renaming the image.

btw,
in the code option shown below from that other topic you posted...where do i go to insert that code? (i'd like to be able to edit the code as well but havent a clue where i insert it.)
<?php  if (count($category->virtuemart_media_id) > 0) {
       echo $category->images[0]->displayMediaThumb("",false);
   } ?>
Title: Re: how do i turn off Virtuemart-category thumbnails? I just want a category list!
Post by: bytelord on October 08, 2012, 23:20:05 PM
That the best way. So you have to create a template override if you haven't already a custom vm template.
If you use overrides then the file is located under your_joomla_folders/templates/your_joomla_templa/com_virtuemart/category/default.php
Edit the file, around line 109 you will find the following line:

echo $category->images[0]->displayMediaThumb("",false);

Relace that line with the following 3 lines:

<?php  if (count($category->virtuemart_media_id) > 0) {
       echo $category->images[0]->displayMediaThumb("",false);
   } ?

if do not use template overrides the default vm template located under your_joomla_folder\components\com_virtuemart\views\category\tmpl\default.php

Copy that file under your_joomla_folders/templates/your_joomla_templa/com_virtuemart/category/default.php
(if the folders doesn't exist create them).

So you have create a template override. Edit the new file and place the lines, save, test it...

More information regarding template overrides could be found here: http://forum.virtuemart.net/index.php?topic=98505.0
Also you could use firebug to examine your site code and css styling: http://forum.virtuemart.net/index.php?topic=102850.0
Using template system: http://dev.virtuemart.net/projects/virtuemart/wiki/Hints_for_the_use_of_the_template_system

Hope it helps you out

Regards
Title: Re: how do i turn off Virtuemart-category thumbnails? I just want a category list!
Post by: adamjedgar on October 08, 2012, 23:34:31 PM
is it possible to create a template override for this in a generic folder so it affects all templates?

i am still working with the default Beez 20 template but intend to change to another one i have downloaded that i like at some point in the future.
Title: Re: how do i turn off Virtuemart-category thumbnails? I just want a category list!
Post by: bytelord on October 08, 2012, 23:35:46 PM
Hello,

when you will change you could copy your file over there ... will work the same. Or from the backend under configuration->templates you are able to select vm templates override.

Regards
Title: Re: how do i turn off Virtuemart-category thumbnails? I just want a category list!
Post by: adamjedgar on October 09, 2012, 00:18:14 AM
i think ill go with the templates override in the backend so long as that doesnt automatically get changed back to the defaults if an update for virtuemart is installed!

would a virtuemart update change this setting?
Title: Re: how do i turn off Virtuemart-category thumbnails? I just want a category list!
Post by: bytelord on October 09, 2012, 00:30:11 AM
Hi,

Normally will not, but is just a click away :)
But don't forget when you upgrade vm to a newer version there will be probably template changes, so you will have to "correct" your custom templates.

Regards
Title: Re: how do i turn off Virtuemart-category thumbnails? I just want a category list!
Post by: adamjedgar on October 09, 2012, 00:35:35 AM
agh, im getting sideswiped at every point in this venture.

my problem is remembering where everything is. i have to keep doing something over and over again or i forget very quickly how to do it. i have already forgotten where on earth the default location is for the noimage.gif so i can replace it with the new 1x1 px one i made.

Ill go back through this thread and re-read it all anyway. Actually im going to end the other thread i started in Virtuemart>Administration as im getting confused which one im responding too...they have now got a bit blurred i think!
Title: Re: how do i turn off Virtuemart-category thumbnails? I just want a category list!
Post by: adamjedgar on October 09, 2012, 00:38:04 AM
found it, \components\com_virtuemart\assets\images\vmgenera

(i cheated...went to my local Virtuemart instillation and did a search for it using explorer) :P 8)
Title: Re: how do i turn off Virtuemart-category thumbnails? I just want a category list!
Post by: adamjedgar on October 09, 2012, 00:43:10 AM
woops didnt paste whole link (and i used the local machine "\" instead of web url "/".

/components/com_virtuemart/assets/images/vmgeneral/noimage.gif
Title: Re: how do i turn off Virtuemart-category thumbnails? I just want a category list!
Post by: bytelord on October 09, 2012, 00:56:54 AM
Fine,

but as i said better way is to use the code. You could create another image for that instead of replace noimage.gif and selected from the backend because next time you will upgrade vm noimage.gif will be replaced with the original. So create one with different name and paste it there. After select that one from the backend, or you could place it to your template images folder.

Regards.
Title: Re: how do i turn off Virtuemart-category thumbnails? I just want a category list!
Post by: 2dmaster on February 16, 2016, 22:13:00 PM
// magic fix
/html/com_virtuemart/category/default_categories.php
<div class="spacer">
<a href="<?php echo $caturl ?>" title="<?php echo $category->category_name; ?>"><?php echo $category->category_name; ?><br />
                     <?php // if ($category->ids) {
                    if (!empty($category->images[0]->file_name)) { // magic fix
                            echo $category->images[0]->displayMediaThumb("",false); // output <img src... />
                            }
                     //} ?></a>
</div>
e.g. at my site http://enimpuls.ru/
whats all '$category->images' have and params ??