Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls

x5 getDir vs getSkins

 
Reply
   X-Cart forums > X-Cart 5 > Dev Questions (X-Cart 5)
 
Thread Tools Search this Thread
  #1  
Old 03-12-2015, 08:08 AM
 
xgarb xgarb is offline
 

eXpert
  
Join Date: Jul 2004
Location: UK
Posts: 263
 

Default x5 getDir vs getSkins

The new architecture is starting to gel in my brain.

Came across this today.

Here: http://kb.x-cart.com/display/XDD/Creating+sidebar+menu+in+customer+area the tpl file is set in the viewer class

Here: http://xcartguru.com/tutorials/x-cart-5-tutorials/building-a-custom-skin-in-x-cart-5/ the tpl is set in Main.php

Is there a rule for which one to choose?
__________________
Core version: 5.5.xx
Reply With Quote
  #2  
Old 03-15-2015, 05:32 PM
  totaltec's Avatar 
totaltec totaltec is offline
 

X-Guru
  
Join Date: Jan 2007
Location: Louisville, KY USA
Posts: 5,823
 

Default Re: x5 getDir vs getSkins

As you probably know by now, templates get added to the site in 3 main ways. Through Main.php by setting a new custom skin directory, through a viewer class assigning a default tpl, or through a tpl file directly adding itself to a list.

Each has its strength in certain situations. When you define your own custom skin directory in Main.php of your module, you create those new directories, and templates placed in those directories will override their counterparts in the core skin directories.

You module can also have its own skin directories in default/en/YourDevId/YourModuleName/ or in admin/en/. This is preferable when you are adding a new template to a list, not simply overriding a core template. These templates can add themselves to a list directly.

You can also build a new viewer class with a default tpl, this is preferable when you need some logic available to your template that is accessed by your view.
__________________
Mike White - Now Accepting new clients and projects! Work with the best, get a US based development team for just $125 an hour. Call 1-502-773-6454, email mike at babymonkeystudios.com, or skype b8bym0nkey

XcartGuru
X-cart Tutorials | X-cart 5 Tutorials

Check out the responsive template for X-cart.
Reply With Quote

The following 2 users thank totaltec for this useful post:
qualiteam (03-20-2015), tony_sologubov (03-18-2015)
Reply
   X-Cart forums > X-Cart 5 > Dev Questions (X-Cart 5)


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 11:29 AM.

   

 
X-Cart forums © 2001-2020