VirtueMart Forum

VirtueMart 2 + 3 + 4 => Templating & Layouts => Topic started by: ahtaylor1 on October 09, 2013, 22:12:55 PM

Title: Themes? Templates? Layout of my "Shop"
Post by: ahtaylor1 on October 09, 2013, 22:12:55 PM
Joomla! 2.5.14 ; PHP 5.3.27

Hi Guys,

Can anyone point to a tutorial for learning the basics of the differences between templates and themes?  Are they not the same thing?

I am making great progress with my first site but don't like the layout of the products on my pages.  How do I go about playing around with the layout?

I'm still struggling with the concept of my template layout and the layout of my products on my pages - not really sure where to look to change.  I think I must have to look in the configuration within VM.  Is this right?
Title: Re: Themes? Templates? Layout of my "Shop"
Post by: jenkinhill on October 10, 2013, 00:12:34 AM
Everything you see on a Joomla page is in a template, or several templates, styled with css. Theme is sometimes used for this same thing.

Use Firebug to look at the page code and suggest changes then apply t5hose changes as template overrides, or by appending css overrides to your Joomla template.css

http://forum.virtuemart.net/index.php?topic=116620.0
http://docs.virtuemart.net/tutorials/33-templating-layouts.html
http://www.ostraining.com/blog/joomla/overrides
Title: Re: Themes? Templates? Layout of my "Shop"
Post by: AH on October 10, 2013, 09:42:38 AM
Good call from Jenkin but not all design is controlled by templates that you can override. 

Some CSS styling (and content) is determined by functions that are not part of the templating construct. I do not advise you messing with them, they are core code and will get overwritten every time you upgrade VM

This information may save you hours of digging around in templates trying to find out where some of the look and feel is derived from.

A couple of examples you may come across when styling your shop

e.g.

Some of the price stucture (Named divs separating different prices and elements of price display)
administration/components/com_virtuemart/helpers/currencydisplay.php).

The layout of the shipping rates is controlled by a plugin function that inserts brackets around the cost of the rates. This is not a templating option as it sits in  administration/components/com_virtuemart/plugins/vmpsplugin.php). (Go figure!)

if ($pluginSalesPrice) {
         $costDisplay = $currency->priceDisplay ($pluginSalesPrice);
         $costDisplay = '<span class="' . $this->_type . '_cost"> (' . JText::_ ('COM_VIRTUEMART_PLUGIN_COST_DISPLAY') . $costDisplay . ")</span>";
      }

If you want a good free editor that can search mutliple files for a particular instance (how the heck do you think I can find various functions/bits of code when I have no idea where to look? - I simply search for the code snippet in the directory structure of my project using this editor!)

http://www.activestate.com/komodo-edit (http://www.activestate.com/komodo-edit)


In addition - get familiar with using language overrides in Joomla.  They are much better than messing around with hard coding your requirements in the direct language files and have the benefit of not being overwritten when you upgrade to a new joomla version