-
AuthorPosts
-
January 8, 2016 at 5:42 am #841616
When code is entered in the Custom Code fields accessible within a template style, activating the "Save" button causes the code to appear as well (cross-populate) in all the other template styles (siblings) belonging to the same template – and in doing so override anything that might be there. The code is written to the database as one of the parameters of a template style – not a template. Therefore it could – I would say should – be unique to a template style. There doesn’t seem to be a need for the code to be written to the database as a parameter of any sibling template style. I don’t know if there are other template-style parameters which work similarly, but I haven’t come across any so far.
It is possible to obtain Custom Code uniqueness for a template style by a "fragile" workaround of sorts: using database privileges directly to enter and/or edit within the parameters field of the template-style in the database. The result remains in place until a change – very likely not related to Custom Code at all – is made through the standard method to any of that template-style’s siblings. The consequence of activating the "Save" button in any sibling template-style is that whatever was style-unique in the Custom Code portion of the parameters field in the database gets overwritten. (As I say, this happens even if Custom Code wasn’t the focus of attention then).
Is this cross-populating of Custom Code something that can be prevented? From my viewpoint it would be a significant improvement for the T3 Framework.
January 8, 2016 at 4:26 pm #841975I did a bit more homework on this. Each of the four Custom Code fields on the Template Manager Edit Style page has a label div adjacent to it. (So does the ON/OFF slide switch for showing the debug module position.) Within the label div is what looks like a button, inscribed (for English language) with the word "Global". That is the default state of things as currently rendered in T3 Framework, and evidently cannot be changed from there. In fact the button lookalike isn’t a button. However, by going to the file /plugins/system/t3/base[OR]base-bs3/params/template.xml it is possible to change the parameter "Global" from the default value of 1 to the value 0; and do so individually for each of the "snippet" fields. There are five of them, including the one for the Show/Hide setting of the Debug module position.
If any of these five "Global" parameters is edited to a value of 0 the corresponding button lookalike is not displayed. In the interest of transparency that’s less than optimum.
As can be gleaned from the location of the xml file, the value of these "Global" parameters works at the "parent" (i.e. template) level. But a value of 0 prevents cross-populating and makes it possible – and durable – for each template-style to have independent content in the Custom Code fields. That’s what I was trying to accomplish.
(A simple way to test this on a "clean" T3 installation – with no content at all – is to insert just comment code such as into any of these fields, and observe whether or not it appears in the Edit Style page of a sibling template style.)
I wish I’d discovered this many months ago! And… perhaps someone else will find it useful to know!
So my question can be distilled to ask whether a means of changing the "Global" parameters in the xml file – perhaps by ON/OFF "slide switches" which would retain their visibility – could be added to the T3 upgrade "to-do" list for inclusion on the Template Manager Edit Style page in place of the button lookalikes.
January 8, 2016 at 4:31 pm #841976Oops – I had a one-word sample of comment code tucked into the fourth paragraph but it didn’t make it in the posting process. It should have gone after the phrase "such as".
Ninja Lead ModeratorNinja Lead
- Join date:
- November 2014
- Posts:
- 16064
- Downloads:
- 310
- Uploads:
- 2864
- Thanks:
- 341
- Thanked:
- 3854 times in 3563 posts
January 11, 2016 at 9:46 am #843988April 19, 2017 at 4:00 pm #1027512This has been for me spectacular help. It took me a couple of days to find this, sorry it took months for you. I had not idea that the auto injection was on the template settings. Really impressed you found the source files and code. Thank You!
-
AuthorPosts
This topic contains 4 replies, has 3 voices, and was last updated by davidwcox 7 years, 8 months ago.
We moved to new unified forum. Please post all new support queries in our New Forum