Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • lytchett Friend
    #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.

    lytchett Friend
    #841975

    I 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.

    lytchett Friend
    #841976

    Oops – 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 Moderator
    #843988

    Hi,

    Regarding details on the custom code for T3 framework you can find it here and all the video guide of T3 from here

    Besides that, if you want to make a custom CSS style, you can create a templates/our_JA_template/css/custom.css file and add all custom code to it.

    Hope it helps

    Regards

    davidwcox Friend
    #1027512

    This 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!

Viewing 5 posts - 1 through 5 (of 5 total)

This topic contains 4 replies, has 3 voices, and was last updated by  davidwcox 7 years ago.

We moved to new unified forum. Please post all new support queries in our New Forum