Zen Cart Logo
Forums / All Other Contributions/Addons / ZC Overrides Cheatsheet

ZC Overrides Cheatsheet

Views: 57,229

Results 21 to 28 of 28
24 Oct 2020, 12:42 PM
#21
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,100
Plugin Contributions:
56

ZC Overrides Cheatsheet

dbltoe:

I've had this as a bookmark for ages. Great tool.

Just wondering a little on the includes/modules/pages portion.

If customizing includes/modules/pages/ask_a_question, would you add header_phpask_a_question.php in the folder or header_phpresponsive_classic.php?

Trying to figure some way to recognize the template being used for that file. Of course there's the problem if the next template is "quick_run" it won't have a chance until the header_phpresponsive_classic.php is removed.

Asking for a friend. :P
You'd add a file named header_php_aaq_template_detect.php (or something similar). The additional per-page header files must match header_php***_something***.php

24 Oct 2020, 12:49 PM
#22
dbltoe avatar

dbltoe

Totally Zenned

Join Date:
Jan 2004
Location:
N of San Antonio TX
Posts:
9,809
Plugin Contributions:
15

Re: ZC Overrides Cheatsheet

Just trying to visualize a way to catch it for loading and clone a template.

To the first, if I have two templates (a and b), and I try to run a without removing b then a will never take effect unless something set in a is not reset in b?

I'm up at the wrong hour and having weird thoughts. :P

24 Oct 2020, 1:03 PM
#23
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

Re: ZC Overrides Cheatsheet

dbltoe:

Just trying to visualize a way to catch it for loading and clone a template.

To the first, if I have two templates (a and b), and I try to run a without removing b then a will never take effect unless something set in a is not reset in b?

I'm up at the wrong hour and having weird thoughts. :P
I wouldn't necessarily use a filename based "tag", if nothing else trying to search out that "key" will be difficult as filenames are not searched in a default developer's toolkit and the further importance of the filename may not be obvious without internal direction. Besides that, the file would be loaded and still need some internal switch to execute the applicable code.

An alternate option is to use an observer off of the applicable file(s), but not sure that addresses your "flag for copying" system...

24 Oct 2020, 9:00 PM
#24
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: ZC Overrides Cheatsheet

I'd name the file header_php_SOMETHING_RELATED_TO_ITS_PURPOSE.php
And then inside you could check the value of $template_dir to take action based on whether/which template is active.

14 Jan 2022, 2:44 AM
#25
dbltoe avatar

dbltoe

Totally Zenned

Join Date:
Jan 2004
Location:
N of San Antonio TX
Posts:
9,809
Plugin Contributions:
15

Re: ZC Overrides Cheatsheet

I'm back fooling with this again as I have a need to show the difference between templates on one page. Site is 1.5.7c with demos and no adds other than the latest bootstrap and a cloned version of it with an added CSS file. Those are the two I want to be able to switch back and forth between.

When I add an old Multi-Template for Users mod to allow selecton by the user, all seems to work fine BUT, the overrides in in the includes/languages/english folder do not seem to respond to the selection.

I can work on not showing classic, template_default, and responsive_classic but I am suspicious that bootstrap might not be following the overrides set by this cheatsheet.

Thoughts?

14 Jan 2022, 1:28 PM
#26
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,100
Plugin Contributions:
56

Re: ZC Overrides Cheatsheet

dbltoe:

I'm back fooling with this again as I have a need to show the difference between templates on one page. Site is 1.5.7c with demos and no adds other than the latest bootstrap and a cloned version of it with an added CSS file. Those are the two I want to be able to switch back and forth between.

When I add an old Multi-Template for Users mod to allow selecton by the user, all seems to work fine BUT, the overrides in in the includes/languages/english folder do not seem to respond to the selection.

I can work on not showing classic, template_default, and responsive_classic but I am suspicious that bootstrap might not be following the overrides set by this cheatsheet.

Thoughts?
Examples would help; please continue any discussion in the Bootstrap 4 template's support-thread.

13 Oct 2024, 8:17 PM
#27
dbltoe avatar

dbltoe

Totally Zenned

Join Date:
Jan 2004
Location:
N of San Antonio TX
Posts:
9,809
Plugin Contributions:
15

Re: ZC Overrides Cheatsheet

Just checking to see if the 2.1.0 changes effect this great tool.

A have the latest laminated and in a drawer next to the computer.:bigups:

14 Oct 2024, 12:20 PM
#28
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,100
Plugin Contributions:
56

Re: ZC Overrides Cheatsheet

dbltoe:

Just checking to see if the 2.1.0 changes effect this great tool.

A have the latest laminated and in a drawer next to the computer.:bigups:
Nope, but the only real change is that some of the directories that were file-system sort order are now alphanumerically sorted.