| ||||||||||
Shopping cart software Solutions for online shops and malls | ||||||||||
|
X-Cart Home | FAQ | Forum rules | Calendar | User manuals | Login |
Custom skins hierarchy | |||
|
|
Thread Tools | Search this Thread |
#1
|
|||||||||
|
|||||||||
Custom skins hierarchy
How is the hierarchy of skins defined? If I want to create a custom skin for XCN, do I have to disable the XCNSkin module? Or can I create a new skin that will overridethe XCNSkin? How would priority be determined between skins?
__________________
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. |
|||||||||
#2
|
|||||||
|
|||||||
Re: Custom skins hierarchy
Totaltec,
If you have the version where the xcart skin is a module, you need to install the latest version. The skin named default is xcn in this version. http://next.x-cart.com/download/trial Priority is always with the default skin and the template engine overrides the default skin with yours. This way you only have to replace the parts you require. It would be useful to look at the xcn skin to get an idea of how it all works. There two places where replacement skins are placed currently. (odd to me) skins/default/modules/<Your DevId>/<Your Module> this is for your modules obviously. Notice that XLite\Module\ where you place your module does not have an 's' on the end but the default/modules does. Just pointing it out as when you type a namespace in it's easy to make a mistake and wonder for hour or so as to whats wrong and skins/<your skin name> If you go litecommerce.com and follow the link through to the wiki you will find some useful if not confusing information. Skinning the Drupal version is much easier believe it or not.
__________________
Xcart 4.4.? Xcart Next Litecommerce with Drupal http://www.corbywebworx.com Custom Mods, Hosting and Support for Xcart-Next and LiteCommerce |
|||||||
|
#3
|
|||||||||
|
|||||||||
Re: Custom skins hierarchy
Thank you Captain! I have skinned the Drupal version of LC, I agree it is easier. I have also successfully skinned the stand alone version now (just last night). I am still confused though, for a while I had my new skin enabled, and the XCN skin enabled, and my skin seemed to be overwriting the XCN skin. Not sure if it is because it initialized first, or what.
I am still curious if there is a hierarchical order of skins, and how that is determined if it exists. This would be pretty important, if you wanted to sell an XCN skin, you would want to know if you should instruct users to disable their existing skin, or if you could code it to put your custom skin first in priority. I'll download the latest version soon, I am still working on the extremely old beta version that was released 2 whole weeks ago.
__________________
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. |
|||||||||
#4
|
|||||||
|
|||||||
Re: Custom skins hierarchy
It looks like you could have several skins loaded so you would have to tell customers to disable existing skins. It would be handy if there was an Appearance setting like in Drupal. CDev I guess would have some priority but any others I don't know without experimenting. Maybe I'll find time to try today.
__________________
Xcart 4.4.? Xcart Next Litecommerce with Drupal http://www.corbywebworx.com Custom Mods, Hosting and Support for Xcart-Next and LiteCommerce |
|||||||
#5
|
|||||||||
|
|||||||||
Re: Custom skins hierarchy
Hi!
Let me explain how this works. Think of a pie made of multiple layers. Each layer is a skin directory added by an X-Cart Next module. First of all, X-Cart Next loads enabled modules. When it finds a module registering a skin directory it puts the directory on top of the previous one. Then, when loading a template or a resource file, X-Cart Next goes through all the layers from the top. When it finds the file it stops and doesn't look in "lower" directories. So, the order in which X-Cart Next goes through skin directories when looking for a "skin" file is the reverse order in which it loads modules registered the directories. What is the order in which it loads modules? First of all X-Cart Next loads modules which other modules depend on. Then it loads the rest alphabetically. An example: Quote:
Now let me explain the difference between "skins/[custom]/" and "skins/default/en/modules/[dev]/[module]/" directories: - when you create a new widget or a template, you place its files into the "skins/default/en/modules/[dev]/[module]/" directory - when you want to replace an existing template, you place your file into the "skins/[custom]/" directory. Take a look at the following example and you'll understand the idea behind this: Quote:
|
|||||||||
|
#6
|
|||||||
|
|||||||
Re: Custom skins hierarchy
Thanks V
Now i understand. Thats really useful information.
__________________
Xcart 4.4.? Xcart Next Litecommerce with Drupal http://www.corbywebworx.com Custom Mods, Hosting and Support for Xcart-Next and LiteCommerce |
|||||||
#7
|
|||||||
|
|||||||
Re: Custom skins hierarchy
Continueing this hierarchy discussion further
If we take for example Minicart.php the list position is specified before the class declaration. We can extend this class and change the position of the list, for example to the sidebar, in the same way as the original, but this results in there being two positions. The original position and the new position. Is it just a simple matter of including a blank template (header.right.tpl) within our new skins or is the better way to deal with this? Having a blank template doesn't seem right to me.
__________________
Xcart 4.4.? Xcart Next Litecommerce with Drupal http://www.corbywebworx.com Custom Mods, Hosting and Support for Xcart-Next and LiteCommerce |
|||||||
|
#8
|
|||||||||
|
|||||||||
Re: Custom skins hierarchy
You can move and replace existing widgets and templates by declaring runBuildCacheHandler() method in your Main.php file as follows:
HTML Code:
|
|||||||||
|
#9
|
|||||||
|
|||||||
Re: Custom skins hierarchy
Now that is really useful. Thanks Vyacheslav
__________________
Xcart 4.4.? Xcart Next Litecommerce with Drupal http://www.corbywebworx.com Custom Mods, Hosting and Support for Xcart-Next and LiteCommerce |
|||||||
|
|||
X-Cart forums © 2001-2020
|