VirtueMart Forum

VirtueMart 2 + 3 + 4 => Templating & Layouts => Topic started by: ostebe on December 09, 2012, 15:26:14 PM

Title: Virtuemart 2 background category title
Post by: ostebe on December 09, 2012, 15:26:14 PM
Hello,

Please help me to solve the two deficiencies in virtuemart 2

1. How can I add a background to the category name in category details page (link http://instalatii.dianrom-ital.ro/categorii/elemente-de-fixare (http://instalatii.dianrom-ital.ro/categorii/elemente-de-fixare) - eg title "Conexpanduri be a gray backround, only the world title and not the photo related ")

2. I tried to put as many products 2/row .... path Configuration / Template / Default number of products in a row - I could not ... go 1,3,4 ... etc. and not 2, I actually tried to 6 every function less 2.

Thank you!
Title: Re: Virtuemart 2 background category title
Post by: bytelord on December 10, 2012, 08:50:18 AM
Hello,

For your first one just use some CSS. The best option is to load a new CSS file inside your template header, e.g. virtuemart.css and placed it under your css folder for example under your joomla template. Inside there you can override everything regarding to vm2 css styling.  (http://forum.virtuemart.net/index.php?topic=90968.0)
Alternative you could use the your template.css file to override you CSS and the better will be to create a new one ... please provide a live url to check your site with firebug also.

On your first question CSS,

.category-view .row .category .spacer h2 a title {
background-color:grey;
}

Use firebug to examine you site code and css styling: https://forum.virtuemart.net/index.php?topic=102850.0
Also here some information regarding css styling: http://www.w3schools.com/css/
-----

On your second question i don't understand what you want to do ...  As i see you haven't place it to 2, but to 1 ... if you have it please try without template overrides and also use firebug to examine the style from your template that possible could infect the row styling (width).

Regards


Title: Re: Virtuemart 2 background category title
Post by: ostebe on December 10, 2012, 20:16:37 PM
my link:

http://instalatii.dianrom-ital.ro/categorii/elemente-de-fixare (http://instalatii.dianrom-ital.ro/categorii/elemente-de-fixare)

thanks
Title: Re: Virtuemart 2 background category title
Post by: bytelord on December 10, 2012, 20:36:19 PM
yes,

i had your link, sorry for asking it again. Please test the css i gave you and also follow the instructions using firebug. The css is based on your link

Regards
Title: Re: Virtuemart 2 background category title
Post by: ostebe on December 10, 2012, 20:56:30 PM
I tried this solution but it did not work
Title: Re: Virtuemart 2 background category title
Post by: bytelord on December 10, 2012, 21:01:01 PM
Hi,

??
But i test it with firebug and is working ... did you clean your browser cache? Did you test it using firebug?

Regards
Title: Re: Virtuemart 2 background category title
Post by: ostebe on December 10, 2012, 21:03:37 PM
I changed style.css and it did not work
I tried with vmsite-ltr.site .... did not work

I was wrong somewhere?

Sorry for insisting, but it's very important for me
Title: Re: Virtuemart 2 background category title
Post by: bytelord on December 10, 2012, 21:19:05 PM
Yes,

you have right, if you want only the a title then you should create a span or div under under your custom template file for category view to separate the h2 tag from the image and after use for your CSS:

.category-view .row .category .spacer h2 {
background-color:grey;
}

Regards
Title: Re: Virtuemart 2 background category title
Post by: ostebe on December 10, 2012, 21:26:10 PM
I'm sorry ... but I'm a beginner
... can you explain how to do this?

thanks
Title: Re: Virtuemart 2 background category title
Post by: bytelord on December 10, 2012, 21:41:26 PM
Hello,

You should create a template override for the category view ... so the category page default template for example is located under joomla_folder\components\com_virtuemart\views\category\tmpl\default.php
To override it just copy the file to your_joomla_folder\templates\your_joomla_template\html\com_virtuemart\category\default.php
If the folders does not eixst on the destination, create them. This a template override and where the category pages are located.

Find where the a href is been displayed and separate the link with the title ... then apply your CSS. Please

Like,
<span class="prodtitle">
echo title ....
</span>

and then your image with the link ...

Use firebug to examine you site code and css styling: https://forum.virtuemart.net/index.php?topic=102850.0

Template Overrides:
Creating Template overrides: https://forum.virtuemart.net/index.php?topic=98505.0
Template System: https://dev.virtuemart.net/projects/virtuemart/wiki/Hints_for_the_use_of_the_template_system

Also take a look on the fields usage:
Product Fields: http://forum.virtuemart.net/index.php?topic=92756.0
Category fields: http://forum.virtuemart.net/index.php?topic=97744.0
$this vs $product: http://forum.virtuemart.net/index.php?topic=100696.0