News:

Support the VirtueMart project and become a member

Main Menu

template creation and CSS classes

Started by Grafica, September 23, 2013, 10:52:31 AM

Previous topic - Next topic

Grafica

Hi, first time I'm trying to create/edit a VirtueMart template. I have some trouble due to the fact that LOTS of markup hasn't a class associated to it.

for example, the DIVs containing the image and the one containing the "product details" button in the shop home/frontpage, don't have a class, while the DIV for the price has it.


[...] div#main_cont div.latest-view div.row div.product div.spacer div

[...] div#main_cont div.latest-view div.row div.product div.spacer div.product-price

[...] div#main_cont div.latest-view div.row div.product div.spacer div


the above are CSS paths for the DIVs containing (in order) image, price, product details button.
as you can see, there's no way to apply a CSS rule to the first withouth applying it to the last one, and vice-versa.

this "problem" is spread on all the code. Am I missing something? Am I proceeding with the wrong approach?

Thanks in advance.

Grafica

I've found a checkbox labeled "Using the VirtueMart CSS" in Configuration/Templates. If I un-check it the shop design will lose any style, but the markup will gain lots of CSS classes assigned to every element

This would partially solve my issue, but:
1) I would prefer to modify the existing style, instead of re-doing everything from scratch. There isn't a way to add classes to the markup without losing the current styling?
2) but the online help suggest to keep the forementioned element checked:
http://docs.virtuemart.net/manual/21-configuration-menu/62-configuration.html#templates

jenkinhill

To add classes/ids to page elements edit the view templates and set the edoted files as template overrides. If adding new css descriptors it is better to either add them to your Joomla templae.css or create a custom.css file. The aim here is that the layout changes do not get overwritten by the next VM update.
Kelvyn
Lowestoft, Suffolk, UK

Retired from forum life November 2023

Please mention your VirtueMart, Joomla and PHP versions when asking a question in this forum

Grafica

Thank you very much for reply.

The override is done in the same way as for other Joomla components, right?

Thanks again!

jenkinhill

Kelvyn
Lowestoft, Suffolk, UK

Retired from forum life November 2023

Please mention your VirtueMart, Joomla and PHP versions when asking a question in this forum