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

Crisp White Skin in 5.3.* - Custom Modifications?

 
Reply
   X-Cart forums > X-Cart 5 > Dev Questions (X-Cart 5)
 
Thread Tools Search this Thread
  #1  
Old 11-22-2016, 06:03 AM
 
Triple A Racing Triple A Racing is offline
 

X-Wizard
  
Join Date: Jul 2008
Location: Manchester UK
Posts: 1,028
 

Default Crisp White Skin in 5.3.* - Custom Modifications?

Thanks to this forum and all the helpful people in it, in our live store, we use a standard XC5 skin, but then modify this in many different ways, via a Custom Module and a very long list of associated modified files. Works very well, it's easy to use (after a steep module creation learning curve...) and it's very upgrade friendly, because you can test the upgrade on the Custom Module in your dev store, prior to running a live store upgrade. It simplifies things too, as no additional Theme Tweaker, Custom CSS /JS or custom_skin changes are needed because the Custom Module completes all the changes itself.

Meanwhile, we are busy deeply investigating Crisp White Skin in our dev store and the best way to re-work that in many areas. This is also, for argument's sake, a Custom Module carrying out lots of changes on a standard XC5 skin. Again, we don't want to use Theme Tweaker, Custom CSS /JS or custom_skin, so in short, can we run a Custom Module on top of an existing Custom Module? i.e. say; Crisp White skin mods module on top of Crisp White skin module? Has anybody tried this?

If the answer is '...yes the logic flow works and there won't be an endless loop...' then in the Main.php file that will be required to make this happen, will the Customer Interface line change from a normal:
Code:
\XLite::CUSTOMER_INTERFACE => array('*custom_module*' . LC_DS . 'customer'),
To a more specific:
Code:
\XLite::CUSTOMER_INTERFACE => array('*custom_module*' . LC_DS . 'crisp_white/customer'),
or something completely different?

If the answer is no.... Then yes we can edit the existing Crisp White skin module related files, but that makes future upgrades a big problem again or we can use Theme Tweaker, Custom CSS /JS or custom_skin but those are our last choices really, but we can't think of any other ways...
__________________
Dev Store & Live Store XC Business 5.4.1.35
Server; Ubuntu 22.04.2 LTS (HWE 6.2.0.26.26 Kernel)) / Plesk Obsidian
Nginx 1.20.4 / Apache 2.4.52 (Ubuntu Backported) / MariaDB 10.11.4 / PHP 7.4.33
Reply With Quote
  #2  
Old 11-23-2016, 11:53 PM
  qualiteam's Avatar 
qualiteam qualiteam is offline
 

X-Guru
  
Join Date: Dec 2010
Posts: 6,373
 

Default Re: Crisp White Skin in 5.3.* - Custom Modifications?

Well, this is possible, but is a bit tricky when you don't know how to do it

Quote:
Originally Posted by Triple A Racing
In a nutshell: What's the best way to customise Crisp White Skin AND many other standard XC settings, but....only using one Custom Module?

Our best guesses so far are:

1) Create a new Custom Module. Turn off the XC Custom Skin Module and only then enable the new Custom Module.

OR:

2) Copy the original crisp white skin module, customise the the module itself (including its identity via Main.php) and then use that.

3) Only use a combination of Theme Tweaker, Custom Skin, Custom CSS / JS. Easiest to apply, but feels messy and longwinded with all those actions...


It will be "4" (see below)

Quote:
Originally Posted by Triple A Racing
Sorry, I forgot to say... The Custom Module illustrated below, has \XLite\Module\AModule and not \Xlite\Module\AModuleSkin within Main.php which is the opposite way round to the 100% functioning live Custom Module. This is because we have assumed that it's impossible to operate two skins (templates) at the same time and therefore it could only ever be Module not AModuleSkin.

Yes, you're right. You can't have two theme modules operating at the same time. So, your custom module should extend \XLite\Module\AModule and not \Xlite\Module\AModuleSkin.

However, instead of registering your template directories from getSkins() method in your module, the module should hack into the Main class of Crisp White theme.

I.e. you should have the standard "Main.php" file without getSkins() method, and another file as follows:

PHP Code:
<?php
// classes/XLite/Module/MyCustom/MyModule/CrispWhiteMain.php

namespace XLite\Module\MyCustom\MyModule;

abstract class 
CrispWhiteMain extends \XLite\Module\XC\CrispWhiteSkin\Main implements \XLite\Base\IDecorator
{
    public static function 
getSkins()
    {
        
$skins parent::getSkins();
        
        
$customCustomerDirectory 'my_custom_theme' LC_DS 'customer';
        if (isset(
$skins[\XLite::CUSTOMER_INTERFACE])) {
            
// The original theme registers its own directory for the "customer interface",
            // so we should combine ours with that one
            
$directories = (array) $skins[\XLite::CUSTOMER_INTERFACE];
            
$directories[] = $customCustomerDirectory;
            
$skins[\XLite::CUSTOMER_INTERFACE] = $directories;
        } else {
            
// The original theme has no directory for the "customer interface",
            // so we just add our directory to the list
            
$skins[\XLite::CUSTOMER_INTERFACE] = $customCustomerDirectory;
        }

        return 
$skins;
    }
}

I haven't tested the above code, but I think it should work.
__________________
Alex Solovev,
Qualiteam

---

User manual Video tutorials X-Cart FAQ

You are welcome to press "Thanks" button
if you find this post useful

Click here to learn how to apply patches

X-Cart Extensions
Reply With Quote

The following user thanks qualiteam for this useful post:
Triple A Racing (11-24-2016)
  #3  
Old 11-23-2016, 11:56 PM
 
Triple A Racing Triple A Racing is offline
 

X-Wizard
  
Join Date: Jul 2008
Location: Manchester UK
Posts: 1,028
 

Default Re: Crisp White Skin in 5.3.* - Custom Modifications?

Hahahaha!

Brilliant! #4 The bit we didn't know / can't see for looking

You can see every time

Thanks again and back once we have tested with a report etc
__________________
Dev Store & Live Store XC Business 5.4.1.35
Server; Ubuntu 22.04.2 LTS (HWE 6.2.0.26.26 Kernel)) / Plesk Obsidian
Nginx 1.20.4 / Apache 2.4.52 (Ubuntu Backported) / MariaDB 10.11.4 / PHP 7.4.33
Reply With Quote
  #4  
Old 11-24-2016, 09:56 PM
 
Triple A Racing Triple A Racing is offline
 

X-Wizard
  
Join Date: Jul 2008
Location: Manchester UK
Posts: 1,028
 

Default Re: Crisp White Skin in 5.3.* - Custom Modifications?

Quote:
Originally Posted by qualiteam
Well, this is possible, but is a bit tricky when you don't know how to do it
We have seen the light... (sic Blues Brothers) It's gone from possible to reality. Thanks!
Quote:
Originally Posted by qualiteam
It will be "4" (see below)
Ha! It's now currently at "4.5" a new kind of blend... See below
Quote:
Originally Posted by qualiteam
I haven't tested the above code, but I think it should work
It does. Perfectly. However, we couldn't see how the getSkins() total deletion from Main.php and then the addition of an extra file only covering the 'customer' area, would process any changes to items located in 'admin', 'common' and 'mail. So brute force over ignorance we added getSkins() back into Main.php but removed the line that refers to 'customer' area. Simply because that is now processed by an additional file in the module directory, exactly as per your previous suggestion on here (our personalised version of it..) and it works perfectly already. The replacement get skins() 'skinny latte' version within Main.php now looks a bit like this:

PHP Code:
public static function getSkins()
    {
        return array(
            \
XLite::ADMIN_INTERFACE    => array('new_directory' LC_DS 'admin'),
            \
XLite::COMMON_INTERFACE   => array('new_directory' LC_DS 'common'),
            \
XLite::MAIL_INTERFACE     => array('new_directory' LC_DS 'mail'),
        );
    } 

In effect, Main.php and the additional file work side by side within the Custom Module. That's fine by us and from the results all of our tests that we have run so far. The sev store current status is:

All changes that we apply to 'admin', 'common', 'customer' (aka the Crisp White skin Module and its visible results that are already applied prior to any changes by ourselves...) and 'mail' are all processed by this single Custom Module, plus all the associated files (copied then customised) located within /skins/new_directory/*

The only challenge that we haven't figured out yet, is applying a logic change to an existing XC Module. Initially, it appears that these MUST still be applied via the XC Custom Skin Module...but we'll work out how to include these in the Custom Module soon... We can apply custom JS and that was only applied by us using the XC Custom Skin Module previously too, so there will be a way to do this.... somewhere.... Back soon
__________________
Dev Store & Live Store XC Business 5.4.1.35
Server; Ubuntu 22.04.2 LTS (HWE 6.2.0.26.26 Kernel)) / Plesk Obsidian
Nginx 1.20.4 / Apache 2.4.52 (Ubuntu Backported) / MariaDB 10.11.4 / PHP 7.4.33
Reply With Quote
  #5  
Old 11-25-2016, 03:27 AM
 
Triple A Racing Triple A Racing is offline
 

X-Wizard
  
Join Date: Jul 2008
Location: Manchester UK
Posts: 1,028
 

Default Re: Crisp White Skin in 5.3.* - Custom Modifications?

Quote:
Originally Posted by Triple A Racing
The only challenge that we haven't figured out yet, is applying a logic change to an existing XC Module....
That's sorted as well now, so... the eagle has landed!

We'll have a break (...deal with our normal business!!) then return. We'll apply lots of mods to the Custom White Skin view, together with all our non 'customer' area XC5.3.* mods and after some final super-tests, to see if we can break anything, we'll transfer this setup onto our live store. Thanks again @qualiteam for the guidance on this one
__________________
Dev Store & Live Store XC Business 5.4.1.35
Server; Ubuntu 22.04.2 LTS (HWE 6.2.0.26.26 Kernel)) / Plesk Obsidian
Nginx 1.20.4 / Apache 2.4.52 (Ubuntu Backported) / MariaDB 10.11.4 / PHP 7.4.33
Reply With Quote
  #6  
Old 11-27-2016, 06:48 PM
 
Triple A Racing Triple A Racing is offline
 

X-Wizard
  
Join Date: Jul 2008
Location: Manchester UK
Posts: 1,028
 

Default Re: Crisp White Skin in 5.3.* - Custom Modifications?

Quote:
Originally Posted by Triple A Racing
....We'll apply lots of mods to the Custom White Skin view...
These have all worked perfectly at the first attempt. That is, until we got to applying changes to this file: /skins/crisp_white/customer/css/style.less This has been done like all the others, by copying and editing the file, then re-presenting the customised file like this /skins/*new_directory*/customer/css/style.less which in turn, is then activated by the Custom Module and should produce the desired results. The same method is applied for all the other desired changes and even to this file, which is right next to the previous .less file! /skins/crisp_white/customer/css/style.css and of course, all other changes work.

With this file, once the system reads the .less file provided by the Custom Module, the public side of the dev store simply looses all the normal view and becomes just a list of links...Remove the customised file, re-deploy and we're back to normal again.

We're guessing that it's to do with the logic route involved, as we can modify .less files elsewhere e.g. within /skins/common without any issues or failures like this one. This is a little different, as we applying a change via the Custom Module to a Module that's already applying changes to the default skin however, it's only this file that has this failure (so far)... The irony is that we can apply the desired change easily by Custom CSS, so that's why we are assuming it's just the logic route that's causing the issue when using the Custom Module?
__________________
Dev Store & Live Store XC Business 5.4.1.35
Server; Ubuntu 22.04.2 LTS (HWE 6.2.0.26.26 Kernel)) / Plesk Obsidian
Nginx 1.20.4 / Apache 2.4.52 (Ubuntu Backported) / MariaDB 10.11.4 / PHP 7.4.33
Reply With Quote
  #7  
Old 11-28-2016, 06:44 PM
 
Triple A Racing Triple A Racing is offline
 

X-Wizard
  
Join Date: Jul 2008
Location: Manchester UK
Posts: 1,028
 

Default Re: Crisp White Skin in 5.3.* - Custom Modifications?

Quote:
Originally Posted by Triple A Racing
...so that's why we are assuming it's just the logic route that's causing the issue when using the Custom Module?
To add to this assumption, we have also tried adding the modified version of the style.less file, not to our Custom Module (we've already done that, see last message) but to the XC Custom Skin Module itself; /skins/custom_skin/customer/css/style.less and no surprise, it has exactly the same effect i.e. the site becomes unusable in terms of view / appearance etc. It's still only possible to modify this specific file via Custom CSS aka the Theme Tweker Module....The mod is exactly the same in all three; Custom Module, Custom skin Module or Custom CSS, but only the 3rd option works as desired. A logic route limit within the Crisp White Skin Module itself is now our current 'best guess' The next module upgrade? Or have we missed something?
__________________
Dev Store & Live Store XC Business 5.4.1.35
Server; Ubuntu 22.04.2 LTS (HWE 6.2.0.26.26 Kernel)) / Plesk Obsidian
Nginx 1.20.4 / Apache 2.4.52 (Ubuntu Backported) / MariaDB 10.11.4 / PHP 7.4.33
Reply With Quote
  #8  
Old 11-29-2016, 07:16 PM
 
Triple A Racing Triple A Racing is offline
 

X-Wizard
  
Join Date: Jul 2008
Location: Manchester UK
Posts: 1,028
 

Default Re: Crisp White Skin in 5.3.* - Custom Modifications?

Whilst waiting for some feedback on that previous question, we have a different (unconnected) question now...

Using either a Custom Module or, the XC Custom Skin Module or, Custom CSS, together with the default X-Cart Standard Template, it's possible and easy to limit the 'Maximum' size (width) of the site itself. Most store owners don't want to do this but some do. It really depends on their own chosen site view and design ideas etc. It only sets a maximum limit, so there's no effect on smaller windows obviously.

Using either a modified .css file c/w Module activation or Custom CSS, here's some code which works very well (we have tried it and used it on XC5.2.* and XC5.3.* setups and it works perfectly on both these cores when using the XC standard template):
Code:
@media (min-width: 1182px) { #page-wrapper { width: 992px; } .sidebar, #content { margin-bottom: 0px !important; }
The XC Crisp White Skin template however is bootstrap based so the CSS rules are different and this same code won't work as it does already, with a default X-Cart Standard Template.

Does anybody have good bootstrap CSS experience and... enough exposure to Crisp White Skin now, so as to figure out the correct or alternative way to make this maximum window size limit work? A long reach question to the CWS Dev Team possibly?
__________________
Dev Store & Live Store XC Business 5.4.1.35
Server; Ubuntu 22.04.2 LTS (HWE 6.2.0.26.26 Kernel)) / Plesk Obsidian
Nginx 1.20.4 / Apache 2.4.52 (Ubuntu Backported) / MariaDB 10.11.4 / PHP 7.4.33
Reply With Quote
  #9  
Old 12-06-2016, 01:49 AM
 
Triple A Racing Triple A Racing is offline
 

X-Wizard
  
Join Date: Jul 2008
Location: Manchester UK
Posts: 1,028
 

Default Re: Crisp White Skin in 5.3.* - Custom Modifications?

Quote:
Originally Posted by Triple A Racing
Whilst waiting for some feedback on that previous question...
A small update on this specific question; 5.3.2 and individual module updates have been released since we asked this one (all are still at Developer Mode at the time of this update we think?) and the XC Custom Skin Module is no longer an option for this now anyway:
Quote:
XC 5.3.2: CustomSkin module evolved to Webmaster mode which is now provided by the module ThemeTweaker....To save your custom_skin customization, simply move your custom template to the folder "theme_tweaker"
Despite using all the latest updates that are available, both our own Custom Module and latest release of the Theme Tweaker Module still cannot and will not process the addition of a customised version of this file: /skins/crisp_white/customer/css/style.less without trashing the site's appearance. So it's back to Custom CSS only, until this can be explained and/or any additional coding/routing can be provided by somebody at XC. We have identified some small bugs in XC 5.3.2 and CWS 5.3.2 and other users have too, so it may be a while before the answer is posted. The feedback from the Developer Wave will obviously take priority.
Quote:
Originally Posted by Triple A Racing
....make this maximum window size limit work?
This, we have solved. If anybody was wanting to do this when using the CWS Module, this works perfectly in all our dev store tests:
Code:
@media (min-width: 1200px) { .container { width: 982px } } @media (min-width: 1200px) { #main { width: 982px } }
__________________
Dev Store & Live Store XC Business 5.4.1.35
Server; Ubuntu 22.04.2 LTS (HWE 6.2.0.26.26 Kernel)) / Plesk Obsidian
Nginx 1.20.4 / Apache 2.4.52 (Ubuntu Backported) / MariaDB 10.11.4 / PHP 7.4.33
Reply With Quote

The following user thanks Triple A Racing for this useful post:
qualiteam (12-07-2016)
  #10  
Old 12-07-2016, 02:19 AM
  qualiteam's Avatar 
qualiteam qualiteam is offline
 

X-Guru
  
Join Date: Dec 2010
Posts: 6,373
 

Default Re: Crisp White Skin in 5.3.* - Custom Modifications?

Quote:
Originally Posted by Triple A Racing
However, we couldn't see how the getSkins() total deletion from Main.php and then the addition of an extra file only covering the 'customer' area, would process any changes to items located in 'admin', 'common' and 'mail'.

You don't need getSkins() in your module's Main.php because your module is not a "skin" anymore. The only active theme is Crisp White, and it has its own getSkins().
So, from you custom module, you hack into that getSkins() method defined in Crisp White, and add your directories so that it looks like Crisp White registered them.

If you want to override admin, common and so on, you add them through that decorated getSkins() method, not from getSkins() defined in your Main.php.

Quote:
Originally Posted by Triple A Racing
Both our own Custom Module and latest release of the Theme Tweaker Module still cannot and will not process the addition of a customised version of this file: /skins/crisp_white/customer/css/style.less without trashing the site's appearance.

I'm waiting a reply from the XC5 dev team on this. My guess is that it is because style.less may be the "base" less file that the theme loads first. But I may be wrong.

Quote:
Originally Posted by Triple A Racing
If anybody was wanting to do this when using the CWS Module, this works perfectly in all our dev store tests: ...

Thank you for sharing this!
__________________
Alex Solovev,
Qualiteam

---

User manual Video tutorials X-Cart FAQ

You are welcome to press "Thanks" button
if you find this post useful

Click here to learn how to apply patches

X-Cart Extensions
Reply With Quote
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 01:37 AM.

   

 
X-Cart forums © 2001-2020